8000 ports/nrf: Add board init macros. by iabdalkader · Pull Request #6757 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

ports/nrf: Add board init macros. #6757

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 1 commit into from

Conversation

iabdalkader
Copy link
Contributor

No description provided.

@glennrub
Copy link
Contributor
glennrub commented Jan 6, 2021

It's a bit hard to see the full picture with this patch as there are no boards/$(BOARD)/*.c existing in the port mainline. I'm not sure about the wildcard include of c-files. However, It would be nice to actually show a sample on how to use this.

I actually didn't notice that this is used in the STM32 port, but the NRF port does something similar.
https://github.com/micropython/micropython/blob/master/ports/nrf/main.c#L226
https://github.com/micropython/micropython/blob/master/ports/nrf/boards/pca10059/modules/recover_uicr_regout0.c#L39

Originally this was made for the micro:bit target to initialize board specific modules, but was re-purposed to also provide a fix for pca10059. It could be an idea to change the pca10059 to use MICROPY_BOARD_EARLY_INIT to test and show how this would work.

Is your need initialization of hardware or board specific modules?

@iabdalkader
Copy link
Contributor Author

That's how it's done in the stm32 port, and it's for doing board-specific early initialization, for example: enable regulators, do workarounds for errata etc...

It could be an idea to change the pca10059 to use MICROPY_BOARD_EARLY_INIT.

Certainly belongs to early_init.

@iabdalkader iabdalkader force-pushed the nrf_early_init branch 2 times, most recently from f37489b to 2b39795 Compare June 9, 2022 10:45
@iabdalkader iabdalkader changed the title NRF: Enable MICROPY_BOARD_EARLY_INIT if defined. ports/nrf: Enable MICROPY_BOARD_EARLY_INIT if defined. Jun 9, 2022
@iabdalkader iabdalkader changed the title ports/nrf: Enable MICROPY_BOARD_EARLY_INIT if defined. ports/nrf: Add board init macros. Jun 9, 2022
@dpgeorge
Copy link
Member

Rebased and merged in 921dd94

I changed the Makefile wildcard inclusion from boards/$(BOARD) to $(BOARD_DIR).

@dpgeorge dpgeorge closed this Jun 17, 2022
@iabdalkader iabdalkader deleted the nrf_early_init branch June 17, 2022 06:20
Wind-stormger pushed a commit to BPI-STEAM/micropython that referenced this pull request Oct 13, 2022
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
0