This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2541 build questions

Other Parts Discussed in Thread: CC2541

I have the SensorTag device, the IAR toolset, and the TI applications.  We can build and run the SensorTag app, and can talk to it from the iPhone. 

 

Now we are modifying the SensorTag app.  We first want to remove the LED functionality.  We found we can remove most references to the LED code, but end up with this linker error: 

 

Error[e46]: Undefined external "HalLedSet::?relay" referred in OnBoard ( C:\TI Dev Files\BLE-CC254x-1.3.2\Projects\ble\SensorTag\CC2541DB\ CC2541DK-Sensor\Obj\OnBoard.r51 )

 

What is OnBoard.r51?  How can we get rid of this LED reference from that file? 

 

Thanks

Mike

 

 

 

  • Hi Mike,

    The simplest way  to remove LED functionality should be to remove the HAL_LED=TRUE symbol from the preprocessor symbol list. If this does not remove all LED functionality please let me know so I can file a bug report.

    If you would like to remove it entirely from the code you might need to to a "Clean" on the project and then choose "Rebuild All". 

    IAR has an overview of its file types that you can find in the Help tool:

    Ext. Type of file Output from Input to

    r51

    r51

    Object module

    Library

    Compiler and assembler

    XAR, XLIB

    XLINK, XAR and XLIB

    XLINK, XAR and XLIB

    Regards,
    Svend 

  • Onboard.r51 is the compiled object file corresponding to OnBoard.c.. You can find this in the TOOLS folder of the IAR project. It likely contains references to HalLed functionality which, since you likely have removed the hal_led.c from the build, can not be resolved by the linker.

    Best regards,
    Aslak 

  • Hi Svend, 

    Thanks for the information.  We are going to remove the files completely from the build.  We'll look at the IAR help files - we hadn't started digging into those yet. 

    Thanks again

    Mike

  • Hi Aslak, 

    Thanks.  We'd looked for the OnBoard.c file before but managed to not find it...  so we were thinking this was probably a pre-compiled file.  Since seeing your reply we searched again and found OnBoard.c...  We did find there were references to the LED functions in there, so we were able to remove them. 


    Thanks!

    Mike

  • Svend,

    I know this is an old post, but I'm having issues customizing the SensorTag firmware to control the LED behavior. No matter what I do, the LEDs are always on. I'm using the CC2541 SensorTag and the 1.4.0 firmware stack. I deleted the HAL_LED symbol from the preprocessor and cleaned and rebuilt all the project files. I've commented out all of the HalLedSet() functions and tried every combination of input variables to the HalLedSet() function.

    Can you please advise as to why the LEDs are always on?

    Thanks.
  • Clifton,

    Hard to say what goes on. HAL_BOARD_INIT() will enable the LED's as outputs even if HAL_LED is not defined, except for that it seems all LED control is wrapped within HAL_LED defines.

    .:svend
  • We found the issue. There's another function called HalLedEnterSleep() that's being called from the hal_sleep.c file. It was toggling the LEDs depending on the power state of the microcontroller.