initial portenta h7 support#1245
Conversation
hathach
left a comment
There was a problem hiding this comment.
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).
| #include "stm32h7xx_hal.h" | ||
| #include "stm32h7xx.h" |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
|
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. |
|
closed due to lack of activities, also the main branch moving too far now. Feel free to open an new PR if needed |
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.