Skip to content

initial portenta h7 support#1245

Closed
bm16ton wants to merge 2 commits into
hathach:masterfrom
bm16ton:master
Closed

initial portenta h7 support#1245
bm16ton wants to merge 2 commits into
hathach:masterfrom
bm16ton:master

Conversation

@bm16ton
Copy link
Copy Markdown

@bm16ton bm16ton commented Dec 16, 2021

Initial support for Portenta H7.

Very easy and simple additions to get the Portenta H7 up and running. I put it into its own folder, not sure if thats correct but between the two cores of diff archs and the weirdness the dual cores seem to bring compared to single core brothers thought it made sense. The i2c pmic gets written to very early init by arduino/mbed I added ruff initial and untested code for that in family.c, but its not tested/trustworth atm. Everything seems ok, the examples need to have the bootloader offset applied to vtor scb and its required includes added. The only weirdness is after a firmware upload via the arduino bootloader, it will reboot 3 or 4 times with a handfull of seconds in between. Then that firmware is solid even after unplugs/replugs. A simple reboot will also stop the rebooting. Im not a programmer, and this is my first ever pull request so please forgive me for any unwitting mistakes.

Copy link
Copy Markdown
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for the PR, it looks good though the application need to be platform independent to run all other MCUs. portenta use h7, which ideally should be put under https://github.com/hathach/tinyusb/tree/master/hw/bsp/stm32h7 . Since you are not familiar with tinyusb bsp build system, I could help updating this PR if you are willing to test it out ( I don't have any portenta to test with).

Comment on lines +33 to +34
#include "stm32h7xx_hal.h"
#include "stm32h7xx.h"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these mcu dependency cannot be included in the application which is meant to run on all mcus. You could move the VTOR set into the board init.

/*------------- MAIN -------------*/
int main(void)
{
SCB->VTOR = 0x08040000;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it really needed, the start up/system init would probably does this for us. I will look closer at this if you are willing to test out my update.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So So sorry I became incredibly sick, But Im mostly back at it now! Thank you guys so much! This project has the best community! Ok So I made sum mistakes, I didnt know any and all git pushes I would do would immediately be added to PR so Things I didnt intend to make it hear did, Im fairly embarrassed. So the vector offset I will hafta try and see if it works without it being specifically listed under main. I currently have several stm32s with boot loaders that all seem to require different levels of offset configs. Most seem fine with .ld having the base address for flash set at offset, sum require the first line of main, (and others something in between) never been smart enuff to figure out why. But I will test. Thank you again! This is an awesome project and your kindness on offering to help me has not gone unnoticed. I see you ask me to try your update, Im a lil confused do you mean you have a branch I should pull and try? Or try putting the offset in the init like you mentioned? So sorry I didnt understand, but yes I would love to test any updates

Copy link
Copy Markdown
Owner

@hathach hathach Jan 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no problem at all, hope you feel OK now. I am a bit busy as well.

I see you ask me to try your update, Im a lil confused do you mean you have a branch I should pull and try? Or try putting the offset in the init like you mentioned? So sorry I didnt understand, but yes I would love to test any updates

Thanks for your kind words and willingness to test it out, I haven't made any changes just yet. But will try to make some changes soon enough.

@bm16ton
Copy link
Copy Markdown
Author

bm16ton commented Dec 30, 2021

Ok so adding -DAPP_START=0x08040000 to the cflags with .ld set to offset didnt work and also cflags set and ldflags set with -Wl,-Ttext=0x08040000 and .ld set to flash base, but all fail, the leds turn on correct and it fails to enumerate. Im sure a simple way to add the offset to the board/family files exists but I just havent found it yet:) Ill keep on it!

@hathach
Copy link
Copy Markdown
Owner

hathach commented Jan 17, 2022

Ok so adding -DAPP_START=0x08040000 to the cflags with .ld set to offset didnt work and also cflags set and ldflags set with -Wl,-Ttext=0x08040000 and .ld set to flash base, but all fail, the leds turn on correct and it fails to enumerate. Im sure a simple way to add the offset to the board/family files exists but I just havent found it yet:) Ill keep on it!

Sorry for late response, I have been a bit busy lately with other works. I will try to make an update on linker stuff later on based on available doc (since I don't have any portenta board). Will let you know when it is available for testing.

@hathach
Copy link
Copy Markdown
Owner

hathach commented Mar 8, 2023

closed due to lack of activities, also the main branch moving too far now. Feel free to open an new PR if needed

@hathach hathach closed this Mar 8, 2023
7FM pushed a commit to 7FM/tinyusb that referenced this pull request Aug 23, 2025
7FM pushed a commit to 7FM/tinyusb that referenced this pull request Aug 23, 2025
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.

2 participants