Skip to content

Adds the atmega1284p CPU and the first version of the INGA board to RIOT#7604

Closed
roberthartung wants to merge 9 commits intoRIOT-OS:masterfrom
roberthartung:boards/inga
Closed

Adds the atmega1284p CPU and the first version of the INGA board to RIOT#7604
roberthartung wants to merge 9 commits intoRIOT-OS:masterfrom
roberthartung:boards/inga

Conversation

@roberthartung
Copy link
Member

No description provided.

Copy link
Member

@lebrush lebrush left a comment

Choose a reason for hiding this comment

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

Looks good. Of course I don't have the hardware to test it. I suggest the following actions:

  • run uncrustify (many things not RIOTish, like 2 space identation)
  • separate in 3 PR (CPU, Board and Tool) for easier review

Is this board available to the public? In the sense can someone buy it somewhere?

* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/

Copy link
Member

Choose a reason for hiding this comment

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

Missing doxygen tags (also in other files)

Copy link
Member Author

Choose a reason for hiding this comment

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

True that.

@lebrush lebrush added the Platform: AVR Platform: This PR/issue effects AVR-based platforms label Sep 15, 2017
@roberthartung
Copy link
Member Author

It's a public, open source platform ( see https://www.ibr.cs.tu-bs.de/projects/inga/ ). Some bought them off of us and some are spread around some other universities as well.

@roberthartung
Copy link
Member Author

@lebrush Thanks for the review. Most changes are done. I am about to add the other versions of INGA as well. Should I will further split the inga-comm/inga-red platform commit into one for each inga-common, inga-red, ...

@lebrush
Copy link
Member

lebrush commented Sep 15, 2017

Personally I would not mind to have all the boards in a PR, but the philosophy so far is to split PR into independent groups :-)

@roberthartung
Copy link
Member Author

@lebrush was talking about commits here, not PRs ;-) What do you mean by "independent groups"?

@lebrush
Copy link
Member

lebrush commented Sep 15, 2017

I don't know... guess I was thinking about something else at the same time of writing. What I meant is 1 PR per feature/fix and being a board a new feature.

@roberthartung
Copy link
Member Author

This should be merged after #7610

Copy link
Contributor

@kYc0o kYc0o left a comment

Choose a reason for hiding this comment

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

I have some minor comments.

I see also that some periph_conf.h files are empty, are they really needed?

#include "periph_conf.h"
/* For GPIO_IN */
#include "periph/gpio.h"
/* from inga_common */
Copy link
Contributor

Choose a reason for hiding this comment

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

This comments can be removed.

#include "periph_conf.h"
/* For GPIO_IN */
#include "periph/gpio.h"
/* from inga_common */
Copy link
Contributor

Choose a reason for hiding this comment

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

Here too.

@roberthartung
Copy link
Member Author

@kYc0o done. We still need to wait for the pcint implementation to be merged before!

@lebrush lebrush added the State: waiting for other PR State: The PR requires another PR to be merged first label Oct 6, 2017
@roberthartung roberthartung force-pushed the boards/inga branch 2 times, most recently from 74cee76 to 7cfe6a3 Compare December 4, 2017 08:38
@PeterKietzmann
Copy link
Member

Without checking any details: Is this PR still waiting for others?

@maribu
Copy link
Member

maribu commented Mar 5, 2019

The ATmega1284P CPU is supported by RIOT by now and seems to work, as it is used by the Mega1284P-Xplained board.

I think this PR could (and should) be updated to add support for the INGA board by using the ATmege1284P implementation merged into RIOT in the meantime. (Are there any missing features in the ATmega1284P? If so, I would suggest to tackle them as separate PR(s). Also: The RTC support seems to be on the right track for merging right now #8842)

@roberthartung
Copy link
Member Author

@maribu We are still waiting on comments for #7610 and respectively #9159. I will create a new PR for a new solution for Pin Change Interrupts asap, so we can finally merge INGA to RIOT.

@maribu
Copy link
Member

maribu commented Mar 5, 2019

@roberthartung: Thanks for pointing that out. I started to read the threads and decided to dive into it tomorrow with a fresh mind...

However: It seems to me that support for the INGA could be added without the AVR implementation of gpio_init_init() supporting GPIO_BOTH for now. While you do have a use case for that for your specific board, I think that code-wise they are not related. (I may be wrong about that, but I guess adding support for interrupts on both flanks for the AVR platform will not touch the code of the individual AVR boards. I guess some code will might end up in boards/common/atmega, but the individual boards will likely not be changed.) So with that in mind: If you want to add INGA support before those issues resolved, I'm happy to review and help.

@roberthartung
Copy link
Member Author

@maribu The PRs are not about having support for GPIO_BOTH. It is about a general support for pin change interrupts, which simply does not exist by now! INGA needs this for the radio to work. I will create a PR for our pin change solution and give you a mention to hopefully finally have a simple and good solution to make it work.

@maribu
Copy link
Member

maribu commented Mar 6, 2019

By "pin changed interrupt" you mean an interrupt is generated when any pin of a port is changed, in contrast to GPIO_BOTH, which generates an interrupt when a specific pin is changed?

@roberthartung
Copy link
Member Author

@maribu There are two types of interrupts on atmel MCUs: External Interrupts and Pin Change Interrupts. External Interrupts are only available on very few pins and have dedicated interrupts (ISRs). Pin Change Interrupts can occur on any GPIO, but share one interrupt per port. GPIO_BOTH simply sets the flank (rising or falling).

@roberthartung
Copy link
Member Author

Waits for #11114 @maribu

@roberthartung
Copy link
Member Author

Once #11122 is merged, we can rebase this on the latest master. Finally!

@benpicco
Copy link
Contributor

Well, #11122 is merged now

@benpicco
Copy link
Contributor

Adding new Atmega boards should be easier now, maybe give this another try?

rtt_cb_t rtt_next_cb;
volatile int cnt = 0;

void rtt_init(void) {
Copy link
Member

Choose a reason for hiding this comment

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

You could split out periph/rtt as its own PR. Without having looked into it closely, I guess this should also be possible to add to cpu/atmega_common instead.

@maribu
Copy link
Member

maribu commented Nov 20, 2019

Adding new Atmega boards should be easier now,

Definitely! The CPU is now there anyway and you could reuse a lot in boards/common/atmega, likely out of the box.

I'm not quite convinced that the RIOT repo however is the right place to add the source of the inga_tool. I'd personally just provide a link to its repo in the board doc and say it is a requirement that the tool installed and can be found somewhere in $PATH. I doubt non-INGA board users would contribute to it and I guess it will be quite hard to get reviews for the tool.

@benpicco benpicco removed the State: waiting for other PR State: The PR requires another PR to be merged first label Feb 12, 2020
@tcschmidt
Copy link
Member

@roberthartung shouldn't we progress here?

@roberthartung
Copy link
Member Author

@tcschmidt @maribu absolutely! As soon as there is some freetime due to the current situation, I will work on that. I am also visiting the institute today, so I might could bring some hardware home.

In addition my student is already working on splitting the power management for cpu/atmega1284p as an independent PR. So we finally have pm_layered for it!

@roberthartung
Copy link
Member Author

Adding new Atmega boards should be easier now,

Definitely! The CPU is now there anyway and you could reuse a lot in boards/common/atmega, likely out of the box.

I'm not quite convinced that the RIOT repo however is the right place to add the source of the inga_tool. I'd personally just provide a link to its repo in the board doc and say it is a requirement that the tool installed and can be found somewhere in $PATH. I doubt non-INGA board users would contribute to it and I guess it will be quite hard to get reviews for the tool.

@maribu The inga_tool is interacting with the FTDI to use some pins to reset the circuit. I could imagine that some boards might require such a tool in the future. Maybe renaming it to ftdi_tool would be okay, if it would be a general solution?

@benpicco
Copy link
Contributor

benpicco commented Apr 1, 2020

You can just download the tool on-demand like bossa, cc2538-bsl or edbg.
This way we don't have to maintain a fork since that tool might also be used outside RIOT. (IIRC you also have Contiki on the inga boards)

@maribu
Copy link
Member

maribu commented Apr 1, 2020

The inga_tool is interacting with the FTDI to use some pins to reset the circuit.

Is a tool for that really needed? E.g. the MSB-A2 board also has an FTDI chip and uses the DTR pin to reset the board. This can be handled by just passing the right flags to the terminal.

@stale
Copy link

stale bot commented Oct 3, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Oct 3, 2020
@stale stale bot closed this Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Platform: AVR Platform: This PR/issue effects AVR-based platforms State: stale State: The issue / PR has no activity for >185 days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants