Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port. #3172

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

antmerlino
Copy link
Contributor

Summary

Adds bare bones support for Arduino Portenta H7

Impact

None.

Testing

Got a nsh console over USART1

@acassis
Copy link
Contributor

acassis commented Mar 25, 2021

Hi @antmerlino please fix the coding style issues and other issues.

@antmerlino
Copy link
Contributor Author

@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 antmerlino force-pushed the arduino-portenta branch 3 times, most recently from 388f27d to a92bd57 Compare May 15, 2021 23:30
@davids5
Copy link
Contributor

davids5 commented May 17, 2021

@antmerlino CI fails looks like you need to rebase on master.

@microhobby
Copy link
Contributor

@antmerlino do you intend to continue with this contribution?

@antmerlino
Copy link
Contributor Author

@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.

@microhobby
Copy link
Contributor

@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.

@microhobby
Copy link
Contributor

🤔 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 ...

@acassis
Copy link
Contributor

acassis commented Aug 24, 2021

@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
Copy link
Contributor

@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: dotnuttx@51e57d0

@microhobby
Copy link
Contributor

@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.

@microhobby
Copy link
Contributor

@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 😔

@microhobby
Copy link
Contributor

microhobby commented Mar 26, 2022

@antmerlino this commit, we need to change also the portenta stm32_boot.c dotnuttx@54e630e

@microhobby
Copy link
Contributor

@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.

@microhobby
Copy link
Contributor

@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 antmerlino force-pushed the arduino-portenta branch 2 times, most recently from 300aa24 to 37dbdfb Compare March 26, 2022 23:43
@pkarashchenko pkarashchenko self-requested a review March 29, 2022 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants