8000 stm32/boards: Add support for Arduino Portenta H7. by iabdalkader · Pull Request #8547 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

stm32/boards: Add support for Arduino Portenta H7. #8547

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

Closed
wants to merge 2 commits into from

Conversation

iabdalkader
Copy link
Contributor
@iabdalkader iabdalkader commented Apr 14, 2022

@iabdalkader iabdalkader force-pushed the arduino_portenta branch 3 times, most recently from 3a13a81 to 79b86ff Compare April 14, 2022 12:49
#define MICROPY_PY_SYS_PLATFORM "Portenta"
#define MICROPY_HW_FLASH_FS_LABEL "portenta"
#define MICROPY_PY_SYS_STDIO_BUFFER (0)
#define MICROPY_STREAMS_POSIX_API (1)
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to enable the btree module (I just forgot to add MICROPY_PY_BTREE to mpconfigboard.mk) but now I realized more changes are needed to enable btree in the stm32 port, so not sure what to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I add support for btree in stm32 port ? It requires the posix_helpers.c file from esp8266 port, which can be compiled conditionally if btree module is enabled.

Copy link
Member

Choose a reason for hiding this comment

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

I've been holding off on adding btree to stm32 because after you add something it's hard to then take it away. btree is a good example of a library that is specialised and relatively large so you don't want to include it if you don't use it, and it is available as a native .mpy file so can be very easily installed on the filesystem when needed.

Do you have a use case for it? Is it acceptable to use btree.mpy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you have a use case for it? Is it acceptable to use btree.mpy?

No, but I enabled it by default for all boards because some users asked for this module specifically in the past. Are you saying there's a pure Python btree module ? If it has the same functionality I think we don't need the C module. If not, I have local changes that enable it conditionally if MICROPY_PY_BTREE=1 is set.

Copy link
Member

Choose a reason for hiding this comment

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

Are you saying there's a pure Python btree module ?

There is a .mpy file that can be built and deployed using:

$ cd examples/natmod/btree
$ make ARCH=armv7m
$ mpremote cp btree_armv7m.mpy :btree.py

It is 13479 bytes in size.

Copy link
Contributor Author
@iabdalkader iabdalkader Apr 21, 2022

Choose a reason for hiding this comment

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

Sorry I didn't realize you're talking about a natmod, don't "compiled" (bytecode) modules also have a .mpy extension? Anyway, this is one option, but it requires the user to clone the repo, build mpy-cross ? build the module, copy to storage, which is a lot of work, I actually thought it was something I could just add to the manifest. Adding support for btree in stm32 on the other hand certainly makes it a lot easier to enable builtin btree for board if it's needed.

Anyway, I removed both the POSIX_API and PY_BTREE options for now, if you want the btree support PR let me know.

Copy link
Member

Choose a reason for hiding this comment

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

Anyway, this is one option, but it requires the user to clone the repo, build mpy-cross ? build the module, copy to storage, which is a lot of work,

It is a bit of work. But we need to move in that direction eventually (we can't include all modules in every build) so need to find a way to make it easier for users. Eg provide pre-build .mpy files and a web-based mpremote to install it.

@iabdalkader iabdalkader force-pushed the arduino_portenta branch 4 times, most recently from 23440ec to 3fe61a5 Compare April 21, 2022 08:41
@iabdalkader
Copy link
Contributor Author
iabdalkader commented Apr 21, 2022

Would it be possible to support a custom jump to bootloader from machine.bootloader() via something like MICROPY_RESET_TO_BOOTLOADER ? Edit, more specifically:

NORETURN void powerctrl_enter_bootloader(uint32_t r0, uint32_t bl_addr) {
    #if defined(MICROPY_RESET_TO_BOOTLOADER)

    MICROPY_RESET_TO_BOOTLOADER();

    #elif MICROPY_HW_ENTER_BOOTLOADER_VIA_RESET

EDIT: See the second commit.

@iabdalkader iabdalkader force-pushed the arduino_portenta branch 3 times, most recently from 74e3a51 to f37944b Compare April 22, 2022 12:57
@iabdalkader iabdalkader force-pushed the arduino_portenta branch 3 times, most recently from b4b98b5 to 44d3ed8 Compare April 27, 2022 06:52
@dpgeorge
Copy link
Member

Merged in 1f33ec1 and 96ad86e

@dpgeorge dpgeorge closed this Apr 28, 2022
@iabdalkader iabdalkader deleted the arduino_portenta branch April 28, 2022 05:49
@dmazzella
Copy link
Contributor

@iabdalkader are there any plans for future specific drivers like DisplayPort over USB-C (anx7625), and secure elements (se050c2)?

@iabdalkader
Copy link
Contributor Author

@iabdalkader are there any plans for future specific drivers like DisplayPort over USB-C (anx7625), and secure elements (se050c2)?

Not that I know of.

@dmazzella
Copy link
Contributor

@iabdalkader i have started with anx7625, currently is a working in progress.

If someone is interested can and wants to help me, I more than willingly accept any form of help!

@iabdalkader
Copy link
Contributor Author

@dmazzella Good luck, sorry if I can't help with that right now as I have lots of other things to do. And btw the secure elements will be supported soon maybe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0