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

Add to documentation: 8-Bit not supported #199

Open
Citrullin opened this issue Feb 19, 2018 · 6 comments
Open

Add to documentation: 8-Bit not supported #199

Citrullin opened this issue Feb 19, 2018 · 6 comments

Comments

@Citrullin
Copy link

Citrullin commented Feb 19, 2018

I used a RIOT OS example, which uses CCN Lite as library. Some errors occurred. I fixed them line by line. Mostly unsigned Int and signed Int comparison. I reached a point where I got the following error:

ccnl-pkt-ccntlv.c:508:5: error: left shift count >= width of type [-Werror]

Since I use an AVR 8-Bit processor, shifting 16-Bit on an int isn't possible. I recommend to just add this somewhere in the documentation. So that people know that 8-Bit MCUs are not supported at the moment. :)

The RIOT OS issue: RIOT-OS/RIOT#8598

@cgundogan
Copy link
Collaborator

@Citrullin thanks for reporting this!

Since I use an AVR 8-Bit processor, shifting 16-Bit isn't possible.

In general, shifting by 16 bits is not impossible for an 8bit architecture.
The compiler just assumes an (8bit) integer type as a result of that shift. Casting the numbers to an integer with a width greater than 16 should suffice. I can provide a patch for this.

I assume you use RIOT. We will also provide a version bump of the CCN-lite package in RIOT, because there were some important changes in the RIOT adapter of CCN-lite.

@Citrullin
Copy link
Author

Citrullin commented Feb 20, 2018

@cgundogan I know that there are strategies for working with 16-Bits and more on 8-Bit MCUs :) It was just a recommendation for now. So, that other people are not frustrated by working with RIOT and therefore with CCN Lite on a 8-Bit MCU. I think the adaption for 8-Bit MCUs could take more time than writing a short notice :D

I will try the whole RIOT features on a 32-Bit MCU, for now. There are also other errors. I take a look into it and will fix them in the future. :) I'll create some pull requests for it.

@mfrey
Copy link
Collaborator

mfrey commented Feb 21, 2018

Are you going through RIOTs code/packages and check if it really builds for 8 bit or are you considering to use CCN-lite on an 8 bit architecture?

@Citrullin
Copy link
Author

Citrullin commented Feb 21, 2018

@mfrey RIOT is build for 8 bit. I already used the shell on an ATMega328P. :) I got a CC1101 module. I want to create a network with it. So, I researched a bit and found the concept of content centric network. I consider using it for IOTA payments on embedded devices. Since I don't care about where I get the information (let's say the balance of an account), this seems to be a good use case for CCN. But still: I need to read more, getting into the specifications, the code etc. That's my current status. So, that's why 32-Bit for now is also reasonable for me. I ordered already some STM32 MCUs. :) But I thought a short notice would be nice for people who are getting into C and RIOT/CCN. Actually I'm also not a regular C embedded developer. I mainly use Scala and Javascript in my commercial work. I'm a junior in C :D

I don't know if I will use it on 8 bit MCUs. At the moment: I consider it. Depends on the use case. I even don't know if a 8 bit MCU is powerful enough for some hashing algorithms. There a few people who already tried hashing on 8 bit MCUs. Seems to be slow. But the speed could be fine for some use cases.

@mfrey
Copy link
Collaborator

mfrey commented Feb 21, 2018

Sounds interesting. Let me know if you're up for a 🍺 in Berlin. There are few challenges with cryptographic operations and ccn-lite

@Citrullin
Copy link
Author

@mfrey Of course :) Just write me on twitter or facebook. Same username as here :)

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

3 participants