Improving support for OpenMote-cc2538

Hi,

I'd like to try and improve RIOT OS support for the OpenMote platform in general, and the TI cc2538 MCU specifically. The most pressing item for me currently is RF support, but I would also like to see support for the ROM API and a few other things (including the sensors on the OpenBattery board, eventually).

I'm new to RIOT and thought I'd try to clear up a few things before getting my hands dirty, so you'll have to excuse me if some of these questions seem obvious/stupid/irrelevant:

1) TI provide open-source firmware for the cc2538, but I can't find any trace of it in the RIOT tree. It seems like there are a few cherry-picked bits and pieces but not in the same format/layout as the original firmware. Is there a reason for not including TI's firmware in the tree verbatim (I'm thinking licensing/re-distribution issues, architectural or coding-style differences, etc)? It seems like this would make fully supporting the MCU a lot easier.

2) To avoid duplication of effort, is there anyone else already working on RF support for this chip?

3) Where should a hypothetical RF driver for the cc2538 live in the tree? Since it's on-chip should it live in the cpu subdir? Or programmed as a "module" the same way as for peripherals?

4) Are there any guidelines or example code for this kind of work? The only other on-chip RF driver I could find to use as a reference is for the nrf51. Perhaps this will do to get me on the right track, but just thought I'd check if there's something I missed.

Thanks! /Aaron

Aaron,

Great idea to improve the OpenMote integration! Have you tried contacting the OpenMote developers for guidance? In my experience they have been very helpful and accommodating. I expect they would appreciate your effort.

Ken

Hi Ken,

Well, I figured this would be the place to reach the devs :slight_smile:

I think I've answered my own questions in the mean time though; it seems @hexluthor has been doing a lot of work on cc2538 support over the past year or so, including (from what I can tell) a more-or-less complete RF driver implementation (PR #2198). So I'm looking forward to that getting merged. Still some work to do on drivers for the OpenBattery sensors though, so I'll probably look into that.

/Aaron

Hi Aaron,

good to hear you want to put some work into the OpenMote! Let me try to answer your questions best to my knowledge:

Hi,

I'd like to try and improve RIOT OS support for the OpenMote platform in general, and the TI cc2538 MCU specifically. The most pressing item for me currently is RF support, but I would also like to see support for the ROM API and a few other things (including the sensors on the OpenBattery board, eventually).

I'm new to RIOT and thought I'd try to clear up a few things before getting my hands dirty, so you'll have to excuse me if some of these questions seem obvious/stupid/irrelevant:

1) TI provide open-source firmware for the cc2538, but I can't find any trace of it in the RIOT tree. It seems like there are a few cherry-picked bits and pieces but not in the same format/layout as the original firmware. Is there a reason for not including TI's firmware in the tree verbatim (I'm thinking licensing/re-distribution issues, architectural or coding-style differences, etc)? It seems like this would make fully supporting the MCU a lot easier.

You can't find it because we are not using it... The main reason for this is manifold: TI's firmware is bloated, in-efficient and I am not sure about the licensing (though this might not be an issue). Personally I also doubt, that it makes porting so much easier - in the end you have to read the ref manual in any case to understand the MCU, so why not program the registers directly without overhead through some vendor library...

2) To avoid duplication of effort, is there anyone else already working on RF support for this chip?

Not sure, did you search the mailing list archive? There might have been something on this in the past...

3) Where should a hypothetical RF driver for the cc2538 live in the tree? Since it's on-chip should it live in the cpu subdir? Or programmed as a "module" the same way as for peripherals?

If I see it right, the radio is register mapped on this SoC, right? In that case the radio driver should reside in the cpu subdir.

4) Are there any guidelines or example code for this kind of work? The only other on-chip RF driver I could find to use as a reference is for the nrf51. Perhaps this will do to get me on the right track, but just thought I'd check if there's something I missed.

Not yet. You saw it right, that the NRF51 is the only SoC with register mapped radio at the moment in RIOT. But you should not 100% trust that implementation, as it is not quite up to the current 'state-of-the-art' in RIOT, ergo it does not implement the netdev2 interface.

Let us know if you need more information!

Cheers, Hauke

Hi,

just wanted to link my self in. I am currently working on a port for the openmote, but I am only making slow progress so far, as I have only limited time unfortunately.

You can find my fork here: https://github.com/AnonMall/RIOT/tree/network

Right now the driver for the RF is sending out data, but receiving is still work in progress. I have to finish the radio port until end of February for work and for my bachelor thesis so until then it should be working.

Cheers, Anon Mall

Hello Hauke, and thanks for the info.

You can't find it because we are not using it... The main reason for this is manifold: TI's firmware is bloated, in-efficient and I am not sure about the licensing (though this might not be an issue). Personally I also doubt, that it makes porting so much easier - in the end you have to read the ref manual in any case to understand the MCU, so why not program the registers directly without overhead through some vendor library...

Okay, I had no idea TI's firmware would be that bad. I'll keep this in mind.

Not sure, did you search the mailing list archive? There might have been something on this in the past...

I've found PR #2198 (assigned to you, actually :slight_smile: which seems to be a fairly complete RF driver implementation for the cc2538 MCU. The original author doesn't seem to be super active (the PR is a year old tomorrow), so I'm wondering what the status is? Judging from the comments it still needs porting to the netdev2 interface.

Apparently @anonmall is also working on a driver[1], which is only half done but scheduled for completion before the end of February. So it would seem that there has been plenty of work done on this already. Just the small matter of getting it into the tree! :slight_smile:

Cheers /Aaron

[1] GitHub - AnonMall/RIOT at network