contiki-os / contiki

The official git repository for Contiki, the open source OS for the Internet of Things
http://www.contiki-os.org/
Other
3.71k stars 2.58k forks source link

cc26xx: ROM_FlashProgram not defined #1200

Closed tonnenpinguin closed 9 years ago

tonnenpinguin commented 9 years ago

Hi guys!

When trying to build a program that uses cc26xxware's ROM_FlashProgram I first get a "implicitly defined function" error while building and a linker error after that. Having looked through the code it seems like ROM_FlashProgram is not defined at all. There is only the NOROM version in flash.c that I could find.

So my question is the following: Is that a bug in cc26xxware (Did they forget to enter the ROM calls?), or is it a bug in contiki (Should we change the define in ti-libs.h to the NOROM version?), or did I misinterpret something?

The same thing is true for ROM_FlashSectorErase and ROM_FlashProgramNowait as well.

Thanks in advance! tonnenpinguin

g-oikonomou commented 9 years ago

You should be using FlashProgram (prototype in flash.h). Check rom.h to see what ROM functions are available to you. I cannot see a ROM_FlashProgram, ergo that macro in ti-glue.h shouldn't be there in the first place.

g-oikonomou commented 9 years ago

Bear in mind that not all xxware functions are mapped in our ti-glue.h. For example, there is no mapping for FlashProgram() or any of the functions in CC26xxware's flash.h. You can add them yourself in your local copy, or you can simply include flash.h and use the CamelCase function directly.

tonnenpinguin commented 9 years ago

Thank you for the quick reply!

I'll directly include flash.h then!