If you ask like me:
"is there a (C-code) BSP? How to setup a CubeIDE project for it? How to have a full Open Source project (to see and manage every single line of code) ..."
and you do not find, you do not get any answer (like me, or as "Arduino does not provide"),
here is my project to share.
It is (links to download below):
-
a full Open Source project (every single line of code as source code, including PMIC configuration, INT vector setup, startup code,. SDRAM config, SDCard config, ETH Network config ...)
-
It is a native C-code project (not any C++ code, not using any "foreign" LIB)
-
it is for STM CubeIDE, with CMSIS RTOS V2, FatFs, LwIP, STM USB Device middleware
The entire source code provides these features:
-
configure the PMIC on board and set it to 3.3V (instead of 3.0V)
-
an UART via USB-C (use TeraTerm)
-
it has a command interpreter on UART (or via network), use "help" first to see which commands are there
-
it initializes, uses and supports: ETH network (not WiFi) - with a web page (HTTPD server running), SDRAM (right now just for testing if bit error free usage), SDCard - for displaying root directory, printing files, creating/writing/deleting a text file, execute a text file as commands (for command interpreter = like a "shell program" executed)
-
Web Server (HTTPD, for web browser), Python command interface via network (send commands from Python scripts), TFTP in order to transfer files to/from SDCard via network TFTP protocol ...
-
SPI, I2C - as user or to recover another Portenta H7 board (when bricked), GPIOs (In/Out,. not Interrupts)
Not used (yet) are: Crypto chip, WiFi/BT chip (no intention to use), QSPI flash memory (potentially I add and need in future)
ATTENTION:
This project (see linker script, BIN file) uses entire Flash space: it overwrites the Portenta H7 bootloader. You need an external debugger connected or use the BOOT1 option (DIP switch and use the STM bootloader instead of Arduino bootloader).
The Arduino bootloader will be overwritten (and is gone, but no worries: the board works fine w/o any Arduino stuff, you can still update and flash newer versions, even w/o a debugger - STM bootloader via BOOT1 is "your friend").
Project Links:
CubeIDE project as ZIP
CubeIDE project exported as archive
The related Python script to access board via (ETH) network:
Python script to access board, send commands via network
The BIN file:
ATTENTION: it has to be flashed from start of MCU flash (0x08000000): use debugger or BOOT1 option.
BIN file: flash it at 0x08000000
Commands
With UART terminal connected (TeraTerm, baudrate 1843200, or any should be fine) - via USB-C cable, enter command "help" to see list of all supported commands.
SDCard needs a command "sdinit 1" first, before you can access, you can do anything with SDCard (other commands). Also TFTP to transfer files to/from SDCard via network TFTP needs this command "sdinit 1" first.
Please, have fun and enjoy my "full Open Source Project" (even using some pieces from other projects, but every single line of code involved is visible to you - exactly what I have asked for or expected when using this board).