-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
STM32: Add F7 and H7 Support #2735
Conversation
Restructures the STM port of Circuitpython to be more generic about the STM32 chip lines to support the F7 and H7 series of chips. Adds the new Packages directory to organize different chip layouts between lines. Makes general changes to the Makefile to condense board-level flags to the minimum and support the new chip series. Adds the new chip line to the Peripherals directory, along with new python tools used to generate peripheral text automatically in the tools/ directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you are downgrading ulab in this currently. Please make sure you have the commit that matches master's checked out.
@tannewt whoops hopefully that's just a submodule update mixup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall the package changes look really really good! I added a few comments about other stuff but nothing super major.
I believe you mean to add a board def for the STMH743 NUCLEO not the discovery.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All stylistic. Massive amount of work, great!
@tannewt is there a way to automate the merging of the translations files? Going into each one and changing that single date that always conflicts is a bit of a chore. |
If we could get rid of the date entirely in the .po translation files, I think that might be just fine, since the files are tracked by git already. |
@dhalbert I was thinking the same thing, it's not a very useful line to include and it always prevents clean merges if you forget to pull from master beforehand. |
Ok, @tannewt @dhalbert @jepler this is ready for another full review. Changes include:
Tested on the H743 and F767 Nucleo boards with I2C (DRV2605), SPI (BMP280) and UART (char send/read), with a Feather F405 as a control. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting better and better! Linker clean up looks good! Will try this out by the weekend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment. Will test and finish the review tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to test this on my Nucleo boards by dragging and dropping the .bin onto the NOD_* drives that appear. The F767 copied ok but I get nothing on the other USB port where I'd expect CIRCUITPY to appear. The H743's .bin is 402.7mb so Mac won't let me copy it over. Should I try using GDB to load with the H7?
@tannewt Looks like we're all set on CI! Anything else you'd like to see wrapped up? |
I still have to test it. Please reply to my top level comment from last time about what I tried. |
@tannewt I've been looking into the issues with startup on each board this morning. It looks like the H7 issue is contained to the .bin file - it loads just fine over GDB, which is why I didn't notice it, so you could try that for testing in the short term. I'm not sure yet why the .bin is so bloated. It has to be something with the linker/port.c allocations - similar posts from other STM32 projects suggest this happens when data is accidentally mapped to RAM or other discontiguous memory spaces. Should we be compensating for the fact that ITCM, DTCM and AXI ram are at spaced addresses (0x00000000, 0x20000000 and 0x24000000 respectively)?. If I use the default linker (leaving out DTCM and ITCM) there's no issue with bin size (comes out as 532kb). I'm not sure when the F767 crash snuck in... it was working fine when I tested busio but there have been a number of requested changes since then. It doesn't even hit main, so somethings pretty off. |
@tannewt fix is in for the F767, it was a startup file issue. Tested it again with my testbench and it seems all is well if you'd like to take a crack at it. Going back to poking around with the H743. |
@tannewt both H7 bin and F7 reset fixes should be in now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the objcopy flags for the hex too, then it'll be good to go!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks!
amaze! |
@tannewt the only stm32f7 boards' i have is openmv cam https://www.adafruit.com/product/4478 and a 32blit, can i test with either? |
@ladyada was going to add the H7 cam next week |
I tested on the two Nucleo boards. I have a 32blit and would be keen to get it going there. I should focus on ESP32-S2 though. |
lol agree. @tannewt keep esp32s2'ing :) @hierophect lemme know when the cam is ready, ill grab one from the office and we can try it out! |
@tannewt note that the H750 on the MicroBlit would require a little extra work since it only has 128k of flash, we'd have to do something like the i.mx has for loading code. |
This PR restructures the STM port of Circuitpython to be more generic about the STM32 chip lines so as to support the F7 and H7 series of chips, which run on the Cortex M7 core at up to 480MHz with advanced peripherals including Camera and Ethernet modules. Changes so far include:
This PR is a work in progress. Remaining tasks include:
Nevertheless, high level review is appreciated, along with any suggestions for new boards in the F7 and H7 to target for support.