Hello,
I try to build a EV with some hoverboard motors, for that I bought a hoverboard mainboard in order to flash
this code.
However, on the board is an Artery AT32F403RCT6 which seems to be a Cortex-M4 device for the Chinese market which is compatible with the STM32F103RCT6 and the GD32F403RCT6.
In order to test the device I compiled one of the example projects using KEIL uVision and uploaded it successfully to the MCU with a Segger J-Link Edu mini.
From this I tried to get the arm-gcc toolchain to work, however, it seems I did something wrong. It compiles successfully and is loaded into the flash, but it does not work. Or to be more precise: There is a self-hold circuit the MCU has to set which it does not. It works fine with the uVision binary, but not my arm-gcc code.
So, does anybody have a clue for me on what I might be doing wrong?
It is the same exact code for both projects. I triple checked my startup-code and my linker script to be somewhat sane.
I verified my jlink-script, which works correctly.
Comparing the two hex files(the working one from uVision and my arm-gcc one) the interrupt vectors seem to be correct, the stack initializer is within the RAM, the code is correctly aligned.
I guess there is either some interrupt problem resulting from misaligned functions or gcc optimizing variables away which it should keep.