2024-02-26 07:06 PM
I use Portenta H7 MCU module. I use it with a STM32CubeIDE project (not Arduino).
I do not like the Arduino IDE - LOL, I am missing several features, esp. not possible to use a HW debugger and to step through my code, no support for HW breakpoints etc. Never mind: I have a full STM32 HAL and STM32CubeIDE based project. I can use external ST-LINK (with Breakout Board).
Portenta H7 comes with an Arduino bootloader flashed: you can flash a new user BIN file (FW) via tool "dfu-util.exe".
I want to keep it, because it is convenient and no need for my users to have a ST-LINK dongle. They can update the FW any time themselves (via USB-C, needed anyway for power and UART command line).
But: I want to use also remote connections, e.g. VNC to the computer where the Portenta H7 is connected (in a lab). I cannot press the reset button quickly twice (I am remote). But I want to activate the Arduino bootloader in MCU flash so that I can update the FW (my new BIN file).
It works!
I have an UART shell command interpreter with command "bootld", implemented this way:
ECMD_DEC_Status CMD_bootld(TCMD_DEC_Results *res, EResultOut out)
{
(void)out;
(void)res;
RTC->BKP0R = 0x0000DF59;
RTC->BKP7R = 0x00000001;
NVIC_SystemReset();
return CMD_DEC_OK;
}
So, it uses the "trick" to write "magic" values into RTC BKP registers. When I fire a reset (here via SW as NVIC_SystemReset();) - the Arduino bootloader sees the magic value and stays in DFU mode (not jumping to my FW entry point as any regular (single) reset button would do). Now I can flash a new FW via "dft-util.exe".
Just:
It takes approx. 10 seconds until I see the fading flashing green LED (as indication that Arduino bootloader is active and in DFU mode). No idea why 10 sec.: a double reset press is way faster (but I cannot do remotely).
If you want to try my project - or you want to use STM32CubeIDE to develop for Portenta H7 (as I do), here is the project:
https://github.com/tjaekel/PortentaH7_WAcouSense
It is a pretty "heavy" project, mainly with these features:
If you do not want to install the entire project and compile:
BTW: via Pico-C you can write C-code scripts for any I2C device connected (there is an example for the IMU sensor, in folder doc). Also SPI is available on the command line: connect SPI devices and write "PIco-C" code (no need for any compiler or to flash FW again).
Solved! Go to Solution.
2024-02-26 07:09 PM
You can flash just the BIN file and enjoy the UART command line, web browser access, PDM MIC via network...
The Portenta H7 purchased should come with the Arduino flash loader - so, you can just flash the BIN file, without to install and compile the entire project.
2024-02-26 07:09 PM
You can flash just the BIN file and enjoy the UART command line, web browser access, PDM MIC via network...
The Portenta H7 purchased should come with the Arduino flash loader - so, you can just flash the BIN file, without to install and compile the entire project.