Topic : STM32F303x6 Wrong ID error and hard fault problems

Forum : ARM

Original Post
Post Information Post
May 26, 2015 - 5:42pm
Guest account

Hit a problem with the CPU ID code when trying to program using RLink. Found a similar article here and was able to change the ID code in the '.sim' file. Should be 438 for the 303x6/8 parts. File has ID 422 which is for 303xB/C and 358 devices. The change worked so that is the good part.

Now the less good. I am using startup_stm32f30x.s and system_stm32f30x.c as they appear to be my only choice. When startup calls SystemInit all seems okay up to the entry point. But I get a Hard Fault exception immediately after when any access to the FPU or RCC is attempted.

FPU is at E000ED00 which matches the code.
RCC is at 40021000 which also checks out.

I have tried everything I can find, to no avail, and the hour grows late.

Help?

TIA,
Gary M

Replies
Post Information Post
+1
0
-1
May 26, 2015 - 5:52pm
Etienne Cassin

Hello Garry,

Thank you for the feedback about the ID code of the STM32F303 device.
A new version of the Rkit-ARM should be released within 2 weeks, the bug will be fixed.

For the second problem we need more information.
Where do you find the files startup_stm32f30x.s and system_stm32f30x.c ?
Are you using the ST library ?

Best regards

Maxime M

+1
0
-1
May 26, 2015 - 5:54pm
Guest account

startup_ is from the RIDE lib directory. system_stm32f30x.c is from the ST F30x GPIO toggle code example. system_stm32F30x.h is from the example as well.

For support code, using the ST F30x peripheral driver library. Files are dated 4-Sep 2012, which seems old for a recently released  part.

Also I should mention I have a 030k6t6 version of the project already running. Am trying to migrate up to the 303k6t6, which is proving to be more than a little difficult. The 030 version came up just fine, as did several stm32f407 projects before that.

+1
0
-1
May 26, 2015 - 5:54pm
Etienne Cassin

Dear Gary,

Thank you for reporting the issue.
We think that the Flash size configuration was too big. In order to solve the issue you should download the following patch file:
ftp://ftp.raisonance.com/temp/Support/A … ile_F3.zip

You should launch Patch_Simfile.bat using a prompt command with administrative rights.

Please, let us know if it solves the issue.
Best regards,

+1
0
-1
May 26, 2015 - 5:55pm
Guest account

Did not fix.

Think I found the problem. 303k6 & 303k8 have 16k of ram. But not contiguous. There is 12k of normal ram at 2000-0000 to 2000-2fff and another 4k (called CCM) at 1000-0000 to 1000-0fff 

Stack is at top of 16k (2000-4000) which doesn't exist. The entry to SystemInit does  a push immediately but the fault doesn't occur until stepping to the next instruction.

Got it. I also use a modified linker file STM32F303K6_FLASH.ld (extra section for flash programming) and had to correct the ram size in that as well. Off and running or at least pretending to be. Now I can go onward to debugging. Happy camper.

+1
0
-1
May 26, 2015 - 5:55pm
Etienne Cassin

Sorry for the confusion, I was speaking about the RAM not the Flash sad
The last problem you encounter is due to the custom script. the issue is now fixed with the default script.

Regards,

+1
0
-1
May 26, 2015 - 5:56pm
Guest account

Pleased for the help, thank you. smile

Gary M