2024-09-09 08:57 AM - last edited on 2024-09-09 09:34 AM by SofLit
Hi everyone,
I’ve recently started exploring embedded software development, and I’m really eager to learn more, especially with STM32CubeIDE, which I began using about a month ago. Currently, I’m working with the Nicla Vision board that features an STM32H747AII6 microcontroller with dual cores: Cortex-M7 (CM7) and Cortex-M4 (CM4).
Arduino IDE Success:
I managed to create a simple LED blink project using the Arduino IDE, controlling LEDs from both CM7 and CM4 without any issues. The LEDs blink as expected.
STM32CubeIDE Attempt:
To deepen my understanding, I tried replicating the project in STM32CubeIDE. Here’s my approach:
arm-none-eabi-objcopy -O ihex ledblink_CM7.elf ledblink_CM7.hex
arm-none-eabi-objcopy -O ihex ledblink_CM4.elf ledblink_CM4.hex
I then flashed the hex files using dfu-util with the following commands:
dfu-util.exe -d 2001:0344 -a 0 --dfuse-address 0x08040000:leave -D ledblink_CM7.hex
dfu-util.exe -d 2001:0344 -a 0 --dfuse-address 0x08100000:leave -D ledblink_CM4.hex
I’m still new to STM32CubeIDE, so I might be missing something basic. I’d really appreciate any guidance or suggestions on what I might be doing wrong or how I can troubleshoot further.
Thanks in advance for your help :))
2024-09-09 09:10 AM
In your CM7 project, ensure you have code to release CM4 from its reset. This usually looks like:
HAL_RCCEx_EnableBootCore(RCC_BOOT_CM4); // Enable boot for CM4
2024-09-09 09:33 AM
Hello @sosopina and welcome to the community,
@sosopina wrote:
The Problem:
- The flashing process seems to go smoothly with no errors, but the LEDs do not blink as expected.
- I noticed that when trying to flash, the addresses 0x80000000 (CM7) and 0x81000000 (CM4) were not writable, but using 0x08040000 for CM7 and 0x08100000 for CM4 allowed flashing.
Not sure I understood the problem here. Are you toggling two LEDs each one from one Core? If yes, does they toggle only when CM7 Flash is at 0x08040000 ? which one is failing the one of CM4 or the one of CM7?
And if you use the STM32CubeProgrammer tool to upload your application, do you get the same behavior?
2024-09-09 09:36 AM
https://store-usa.arduino.cc/products/nicla-vision
Probably relates to an Arduino Boot Loader, loaded and protected at 0x08000000, and what it's criterion for running whatever you've built/placed at 0x08040000.
You'll likely need to get involved in the specific details of the implementation.
2024-09-10 01:42 AM
Hello
Following your suggestion, I added the line HAL_RCCEx_EnableBootCore(RCC_BOOT_C2); in my CM7 project to release CM4 from its reset.
Unfortunately, after making this change, the behavior remains the same.
the LED turns on green but whats expected is that it turns blue and red while blinking
I double-checked the memory addresses, and the flashing process completes without any errors, yet it seems like CM4 is not running as intended.
Here u can find the main files for both CM7 and CM4 in the attached files
Thank you
2024-09-10 01:50 AM
Hello and thank you,
well thats exactly what im trying to do (toggle an led from each core) but they both dont toggle and instead it turns on green and its stays the same but it should be blinking red and blue, its an rgb btw
so im thinking CM4 is not running as intended.
and for the programmer it doesnt detect the board, so for now the only thing that detacts and flashes my device is dfu-util
so the flashing goes fine with no errors but its not what i, expecting
Thank youu