Skip to content
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

Collaborators wanted! #1

Open
h2zero opened this issue Nov 27, 2021 · 8 comments
Open

Collaborators wanted! #1

h2zero opened this issue Nov 27, 2021 · 8 comments

Comments

@h2zero
Copy link
Owner

h2zero commented Nov 27, 2021

If anyone would like to help build this up for a release please comment in this issue thread.

Todo:

  • add more boards
  • add documentation
  • add wrapper library for FreeRTOS
    add github actions ✔️
  • convert remaining nRF5 legacy code to use nrfx
    PlatformIO integration ✔️ Can be found here: https://github.com/h2zero/platform-n-able
    build platform_index.json ✔️
@freylax
Copy link

freylax commented Dec 31, 2021

I would like to contribute, need it for the meshtastic.org nrf52 integration. It is based on PlatformIO, so I would concentrate on this first. I would appreciate hints for doing this, I'm new to all this environments..

@h2zero
Copy link
Owner Author

h2zero commented Dec 31, 2021

Great, thanks for the interest. I have started on the platform, you will find it here https://github.com/h2zero/platform-n-able

There is an example in there that you can use. This is very rough at the moment and support needs to be added to import the macro definitions from the boards.txt file, especially the __STACK_SIZE and __HEAP_SIZE. I have hard coded it here but that is only to test and needs to be removed/replaced.

We also need to create a framework script for nRF52 boards, idea's to do this can be borrowed from here https://github.com/platformio/platform-nordicnrf52.

It's a rough start but it's a start.

@freylax
Copy link

freylax commented Jan 6, 2022

So what I did find out it, that the settings of the boards.txt file of the framework repo like eg framework-arduinofruitnrf52
have their corresponding settings in the boards/the_specific_bord.json files in the platform repo. In the case of the __STACK_SIZE it belongs to the extra_flags build settings. How this mapping from boards.txt to .json was done I do not know, if it is hand made or done by a script... But for first we could try by hand withe the waveshare board.
An Outline of the migration from arduino to platformio I found here:
https://community.platformio.org/t/how-to-import-use-custom-arduino-board-for-stm32l4/15792

@h2zero
Copy link
Owner Author

h2zero commented Jan 6, 2022

Great! Thanks for digging into this 😀. That link is helpful for sure.

@freylax
Copy link

freylax commented Jan 7, 2022

There is no automatic conversion process from arduino to platformio, because
it is not 100% compatible, how to deal with the arduino menu settings...
stm32duino/Arduino_Core_STM32#924 (comment)
I was looking for existing parsers of the boards.txt file.

@h2zero
Copy link
Owner Author

h2zero commented Jan 8, 2022

I suspected that, great investigative work!

Looks like we need to define the base values for __STACK_SIZE and __HEAP_SIZE in the extra flags for the each board using the extra_flags in the json. This shouldn't be too much of a problem as the values would be the same for each chip model. I'll look into this a bit as well.

@freylax
Copy link

freylax commented Jan 8, 2022

I am happy when we manage to see things more clearly!
__STACK_SIZE and __HEAP_SIZE comes from your nimble implementation right? It is defined on the mynewt implementatioin as well I suppose? How is it done there, I will have a look.
I also will look how the current nrf5 platformio arduino handles the board variants which are menu entries in the boards.txt file, which could be easily detected by just looking at the according .json board files.
The adafruit arduino lib put the __STACK_SIZE definition into their linker script:
https://github.com/adafruit/Adafruit_nRF52_Arduino/blob/bf2cff4b2faa075aa5c87975f70f11bb6492ff7f/cores/nRF5/linker/nrf52_common.ld#L53
Maybe taking this as base..

@h2zero
Copy link
Owner Author

h2zero commented Jan 8, 2022

__STACK_SIZE and __HEAP_SIZE comes from your nimble implementation right? It is defined on the mynewt implementatioin as well I suppose?

Those are linker macros actually, used here to set the sizes to maximize available ram, they don't have anything to do with NimBLE. When we define the on the command line the linker uses those values instead of the ones in the script. So all we need is to define them where they will be added to the command.

@h2zero h2zero pinned this issue Aug 6, 2022
@h2zero h2zero unpinned this issue Sep 17, 2023
@h2zero h2zero pinned this issue Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants