Hi,
I've been moving the flight firmware dRonin from ChibiOS 2.6.6 onto 17.6.3. Everything seems to compile fine and the STM32F405RGT-based test boards fire up and reach the main() function just fine, halInit() and chSysInit() execute without error. But once I create the very first thread (outside ChibiOS' idle thread), the MCU will hang at _port_switch in chcoreasm_v7m.s. At least that's where I've tracked it down to with a code canary. I haven't any more details, I'm yet to receive my STLink (never really needed it up until now). Any ideas what this might usually be a symptom of?
Thanks for any hints.
Code hangs in _port_switch, any clues?
Moderators: RoccoMarco, barthess
- Giovanni
- Site Admin
- Posts: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
Re: Code hangs in _port_switch, any clues?
Hi,
Hard to tell but please make sure:
1) Use a makefile from the new version.
2) Use xxxconf.h files from the new version.
3) Enable debug options in chconf.h and see if something is caught.
Giovanni
Hard to tell but please make sure:
1) Use a makefile from the new version.
2) Use xxxconf.h files from the new version.
3) Enable debug options in chconf.h and see if something is caught.
Giovanni
Re: Code hangs in _port_switch, any clues?
I got my STLink and had a fun time.
The reason things went sideways were how our Makefiles and ChibiOS went together. A bunch of changes I made to get things to compile caused the FPU configuration not being handled correctly, leading to the CORTEX_USE_FPU flag being present in the assembler compilation, but not in the C compilation. So the context struct didn't have any FPU registers, but the context switching code assumed them to be there. So it picked the data for the program counter from the wrong place.
The reason things went sideways were how our Makefiles and ChibiOS went together. A bunch of changes I made to get things to compile caused the FPU configuration not being handled correctly, leading to the CORTEX_USE_FPU flag being present in the assembler compilation, but not in the C compilation. So the context struct didn't have any FPU registers, but the context switching code assumed them to be there. So it picked the data for the program counter from the wrong place.
- Giovanni
- Site Admin
- Posts: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
Re: Code hangs in _port_switch, any clues?
Hi,
Makefiles pass those flags to both C and ASM modules. If in doubt look in makefiles provided with demos.
Giovanni
Makefiles pass those flags to both C and ASM modules. If in doubt look in makefiles provided with demos.
Giovanni
Who is online
Users browsing this forum: No registered users and 13 guests