Skip to content

Conversation

jgillick
Copy link

@jgillick jgillick commented Mar 22, 2020

This PR makes the following STM port changes:

  • Adds the Thunderpack board
  • Adds NVM support.
  • Fixes an issue with disabling VBUS sensing.

Note on NVM support
The smallest flash sector STM can write to is 16k. To prevent using too much RAM while writing, my implementation caps the NVM byte array size to 512 bytes. The reason I didn't use CIRCUITPY_INTERNAL_NVM_SIZE is that is used in stm/supervisor/internal_flash.h to calculate the overall flash layout.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thanks for this! It looks like a really interesting form factor!

Copy link
Collaborator

@hierophect hierophect left a comment

Choose a reason for hiding this comment

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

This looks good to me in terms of style, but I'm wondering if we can wrap this into the usual flash write API to save some of this flash waste. @tannewt do you think it'd be feasible to put NVM at the end of an existing flash sector, like the last sector of the filesystem? The internal flash write already has RAM allocated for copying and editing sectors in the internal filesystem region.

@hierophect hierophect requested a review from tannewt March 24, 2020 13:54
Copy link
Collaborator

@hierophect hierophect left a comment

Choose a reason for hiding this comment

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

Thanks for the changes! @tannewt this looks good to me for now, but pending your feedback I'd like to revisit this nvm sector location stuff as part of the internal flash fixes down the line.

@hierophect hierophect added the stm label Mar 24, 2020
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

This looks good to me! I'm fine with a NVM refactor after this.

@tannewt
Copy link
Member

tannewt commented Mar 24, 2020

I'm going to merge this and will watch the CI. I think it should be fine.

@tannewt tannewt merged commit f414f2b into adafruit:master Mar 24, 2020
@jgillick jgillick deleted the jgillick/circuitpython/stm32f411 branch March 26, 2020 05:12
@hierophect
Copy link
Collaborator

@tannewt this ended up failing every other STM32F411 board with an internal filesystem due to a bad ifdef in internal flash :C let's make sure we let the CI complete next time we add a build flag like this.

@tannewt
Copy link
Member

tannewt commented Apr 9, 2020

@hierophect The CI has been passing after this was merged in: https://github.com/adafruit/circuitpython/runs/534277499 for commit 59eb35d

I'm not sure why you are saying it's broken.

@hierophect
Copy link
Collaborator

@tannewt I'm confused, that's for the Commander? This one had an issue where #ifdef CIRCUITPY_NVM in the internal_flash.c file would always trigger because CIRCUITPY_NVM was always set. It caused other boards that didn't have NVM to lack a definition for INTERNAL_FLASH_FILESYSTEM_START_ADDR.

@hierophect
Copy link
Collaborator

hierophect commented Apr 9, 2020

@tannewt ah nevermind my mistake. It was caused by a merge issue since I needed to factor the filesystem start into each chip definition for the F7 and H7. The merge didn't duplicate the line for the #ifdef. My bad, I assumed that was causing the test failure.

That said, it does say it failed the tests - but I guess that's just a git actions thing?

@tannewt
Copy link
Member

tannewt commented Apr 9, 2020

Ya, GitHub Actions has been really flaky and I don't want to hold people up due to something we can't control.

@hierophect hierophect changed the title Add new STM board: Thunderpack STM32: Add new STM board: Thunderpack Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants