nuttx
nuttx copied to clipboard
Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.
Summary
Adds bare bones support for Arduino Portenta H7
Impact
None.
Testing
Got a nsh console over USART1
Hi @antmerlino please fix the coding style issues and other issues.
@acassis Will do... I'm tied up with some other things at the moment but I'll clean it up in the coming week.
@antmerlino CI fails looks like you need to rebase on master.
@antmerlino do you intend to continue with this contribution?
@antmerlino do you intend to continue with this contribution?
@microhobby I don't plan to develop the Portenta platform further, but I would like to find the time to finish this basic support and get it merged. Just hasn't been a priority.
@antmerlino do you intend to continue with this contribution?
@microhobby I don't plan to develop the Portenta platform further, but I would like to find the time to finish this basic support and get it merged. Just hasn't been a priority.
@antmerlino ok, no problem, I would like to help. I'm working on a linker to use DFU bootloader, as I don't have any breakout with access to programmer pins. But now I'm stuck in a hardfault:
up_assert: Assertion failed at file:irq/irq_unexpectedisr.c line: 51
up_registerdump: R0: 0000001e 00000000 e000ed14 00070200 e000ed0b ffffffff e000e100 00000000
up_registerdump: R8: 00000000 00000000 24070000 00000000 00000018 24000f38 08041381 00000000
up_registerdump: xPSR: 00000200 PRIMASK: 00000000 CONTROL: 00000000
up_registerdump: EXC_RETURN: ffffffe9
Can you confirm that with your patches it is possible to access nsh without problems? I don't know if this is due to a rebase with the master, or my linker script... Thanks in advance.
🤔 setting flash section to 0x0804000 and defining # CONFIG_ARMV7M_DCACHE is not set to the defconfig made a working nsh through the default DFU bootloader from Portenta. But to be honest I'm not sure if this has any side effects ...
@microhobby this offset 0x0804000 should depend of CONFIG_STM32H7_DFU please search for CONFIG_STM32_DFU for reference (it is defined at arch/arm/src/stm32/Kconfig)
@microhobby this offset 0x0804000 should depend of CONFIG_STM32H7_DFU please search for CONFIG_STM32_DFU for reference (it is defined at arch/arm/src/stm32/Kconfig)
Yeah, I did exactly this! Thanks @acassis. For now my changes are here: https://github.com/dotnuttx/incubator-nuttx/commit/51e57d048d67456a1287f8256b3115f119b80f23
@antmerlino you still need to rebase your https://github.com/antmerlino/incubator-nuttx/tree/arduino-portenta with the https://github.com/apache/incubator-nuttx/tree/master . I think this would solve the checks issues, thanks.
@antmerlino I tried to build it on my environment and I had the same error:
./stm32_boot.c:32:10: fatal error: arm_arch.h: No such file or directory
32 | #include "arm_arch.h"
| ^~~~~~~~~~~~
compilation terminated.
ERROR: arm-none-eabi-gcc failed: 1
command: arm-none-eabi-gcc -M '-fno-builtin' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-g' '-Os' '-fomit-frame-pointer' '-fno-strict-aliasing' '-fno-strength-reduce' '-fomit-frame-pointer' '-march=armv7e-m' '-mtune=cortex-m7' '-mthumb' '-mfpu=fpv5-d16' '-mfloat-abi=hard' '-isystem' '/home/castello/projects/N/dotnuttx/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-D__KERNEL__' '-pipe' '-I' '/home/castello/projects/N/dotnuttx/nuttx/sched' '-I' '/home/castello/projects/N/dotnuttx/nuttx/arch/arm/src/chip' '-I' '/home/castello/projects/N/dotnuttx/nuttx/arch/arm/src/common' '-I' '/home/castello/projects/N/dotnuttx/nuttx/arch/arm/src/armv7-m' ./stm32_boot.c
With the rebase something from master degraded the portenta build 😔
@antmerlino this commit, we need to change also the portenta stm32_boot.c https://github.com/dotnuttx/incubator-nuttx/commit/54e630e14d7e32d6f81ae79d4e5df3d2fa787ef0
@antmerlino Sorry for the delay, but other things have also changed. I put it in some reviews. I believe that it's all now (at least I had one successful build on my environment). Thanks for working on it.
@antmerlino I think that the best would check again the STM32H747I-DISCO base changes to match with the portenta port, unfortunately many things have been changed in NuttX during the time PR has been open. Although a build with nsh is possible, the code is out of date with what was done in NuttX 😔 (please don't be discouraged, we are close!)
@antmerlino the files that are still not in the apache license format:
https://github.com/antmerlino/incubator-nuttx/blob/arduino-portenta/boards/arm/stm32h7/portenta-h7/scripts/user-space.ld
https://github.com/antmerlino/incubator-nuttx/blob/arduino-portenta/boards/arm/stm32h7/portenta-h7/scripts/memory.ld
https://github.com/antmerlino/incubator-nuttx/blob/arduino-portenta/boards/arm/stm32h7/portenta-h7/scripts/kernel.space.ld
https://github.com/antmerlino/incubator-nuttx/blob/arduino-portenta/boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c