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

Support for NRF arm processors #36

Merged
merged 16 commits into from Jun 6, 2020
Merged

Support for NRF arm processors #36

merged 16 commits into from Jun 6, 2020

Conversation

el-han
Copy link
Contributor

@el-han el-han commented May 13, 2020

Since I love the features of the Nordic NRF5 series processors I would love to be able to use them with modm. Some days ago I have started to implement a device tree generator similar to #19.

Nordic offers .svd files, linker scripts, startup code and CMSIS headers on their webpage:

https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-MDK/Download

Although I'm quite busy these days and may need some time to answer I am happy about any comments and leads.

TODO

  • check if license of the Nordic MDK is suitable
  • extract memory size and location from linkerscripts
  • extract device instances from *.svd
  • Unlike the AVR and STM32 microcontrollers it seems every GPIO can be connected to an arbitrary peripheral. How can I implement this?
  • extend the identifier, add pin, memory and package descriptor

@salkinium
Copy link
Member

I love this! ALL THE DATA!!

Unlike the AVR and STM32 microcontrollers it seems every GPIO can be connected to an arbitrary peripheral. How can I implement this?

With a separate table that lists the possible peripherals. Like I did for STM32F1 remap tables. The user must then explicitly parse this information.

I'm trying to change this with #35, where the knowledge about the device file format is kept in this repo and only a Python API is exposed to the user. In this case the API would simply pretend that the table was there for every pin. (I'm just currently too busy to make significant progress).

modm-io/modm#194 is complete for the Cortex-M part, so the startup and interrupts and SysTick all work, it's "just" missing the actual HAL implementation (basic GPIO is already there). So you should be able to use it as a blueprint for NRF52.

Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

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

Very nice, looking forward to seeing more data! 😃

tools/generator/dfg/nrf/nrf_device_tree.py Show resolved Hide resolved
tools/generator/dfg/nrf/nrf_device_tree.py Outdated Show resolved Hide resolved
tools/generator/dfg/nrf/nrf_device_tree.py Outdated Show resolved Hide resolved
devices/nrf/nrf52810.xml Outdated Show resolved Hide resolved
@el-han
Copy link
Contributor Author

el-han commented May 25, 2020

Unlike the AVR and STM32 microcontrollers it seems every GPIO can be connected to an arbitrary peripheral. How can I implement this?

With a separate table that lists the possible peripherals. Like I did for STM32F1 remap tables. The user must then explicitly parse this information.

As far as I understand the remap tables are a tool too keep different sets of signals together to use either the SPI pins from group 1 or from group 2 but not MISO from group 1 together with MOSI from group 2. The Nordic chips on the other hand seem to have a full featured crossbar switch and allow the user to connect an arbitrary signal to each GPIO.

Looks like remap tables won't help me here. Right now I just add the list of all signals to each GPIO pin which produces a huge .xml. But actually I would just need one list of all signals and one list of all GPIOs. Do you have any suggestions? Do you know any other microcontroller which lets the user connect signals to GPIOs without any bounds?

@salkinium
Copy link
Member

I meant that you can simply add the signal list once to the gpio driver as a top-level list. The modm module then knows that it must use this table for all gpios. The reference to the remap table was just to show that there isn't a fixed format for GPIO signals.

@salkinium
Copy link
Member

So you can add a signal list just like the vector table and the memory table are top-level inside the core module because the tag name is the list identifier.

@el-han
Copy link
Contributor Author

el-han commented May 25, 2020

Uh, so it's easier than I thought! Nice.

@el-han
Copy link
Contributor Author

el-han commented May 25, 2020

Okay, all TODOs are checked now. I think I'm ready for a review. I will continue tomorrow, maybe with the C++ part.

@el-han el-han marked this pull request as ready for review May 25, 2020 12:21
Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

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

I'm quite happy with this, you did everything right despite the lack of documentation ;-P
I cannot judge the data much since I'm not familiar with the NRF families.

I'd be happy to merge this now, and then later perhaps have a smaller PR that fixes/adds some things that you find during porting to modm. Is that ok?

@el-han
Copy link
Contributor Author

el-han commented Jun 4, 2020

Yes, that is great! I wrote myself a big reminder to absolutely provide at least some documentation before continuing the C++ part ;-)

@salkinium salkinium merged commit 2576e42 into modm-io:develop Jun 6, 2020
@salkinium
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants