Hello,
I have been working on a project for a while with Keil, and I recently decided to migrate to SES. I thought the import feature in SES would be enough for the transition, but apparently I am missing something since my project doesn't work on my board anymore. I was able to narrow down the scope of search by replicating the issue with a simple project. Basically, those are the steps I followed:
Every time I run the code, I get a hard fault when it tries to initialize the USB peripheral. This issue happens specifically after I enable the global interrupt for USB (USB_EnableGlobalInt function). After returning from that function, the hard fault occurs. Oddly enough, there is no hard fault when I step thought the code line by line which makes me believe that stepping line by line disables the interrupts. The issues still remains though, and when looking at the call stack, I didn't see anything corrupted on the stack or any function having an address out of range.
Note: The same project, builds and works with no issue when I build it using the external configuration based on Keil.
Is there any debugging steps that any of you can recommend? Is there a setting in SES that I am missing?
For now I don't have a clue to what is happening, so any help would be appreciated.
Thank you.
I have been working on a project for a while with Keil, and I recently decided to migrate to SES. I thought the import feature in SES would be enough for the transition, but apparently I am missing something since my project doesn't work on my board anymore. I was able to narrow down the scope of search by replicating the issue with a simple project. Basically, those are the steps I followed:
- In Stm32CubeMX V4.24.0 in created a project for STM32F407VG
- I added the RCC peripheral with configuration HSE crystal source and LSE crystal source
- I added the USB_OTG_FS peripheral with mode Device_Only
- I added the USB_DEVICE middleware with class for FS IP to be MAss Storage Class
- I set the clock HCLK to 168Mhz
- I generated the code for MDK-ARM V5 toolchain with increased heap size of 0x2000 and stack size of 0x4000
- In SES V3.34 I ported the project and successfully built it using the internal build configuration
- I loaded the project on my custom board and entered debug mode
Every time I run the code, I get a hard fault when it tries to initialize the USB peripheral. This issue happens specifically after I enable the global interrupt for USB (USB_EnableGlobalInt function). After returning from that function, the hard fault occurs. Oddly enough, there is no hard fault when I step thought the code line by line which makes me believe that stepping line by line disables the interrupts. The issues still remains though, and when looking at the call stack, I didn't see anything corrupted on the stack or any function having an address out of range.
Note: The same project, builds and works with no issue when I build it using the external configuration based on Keil.
Is there any debugging steps that any of you can recommend? Is there a setting in SES that I am missing?
For now I don't have a clue to what is happening, so any help would be appreciated.
Thank you.