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.

CC2630: working example of the RF (or help for debugging a hardfault)

Part Number: CC2630
Other Parts Discussed in Thread: SEGGER, CC2650, SIMPLELINK-CC13XX-CC26XX-SDK

I am trying to write a custom firmware for an existing board (it's an e-ink shelf tag) based on the CC2630.

(So yes I know it's not recommended for new designs, but it's an existing design).

Unfortunately I've not been able to create anything useful for now. There is zero useful information available anywhere in ti's documentation for this.

Anyway, I've been able to compile and upload an hello-world example code using contiki-ng, but I had to comment the mac initialisation function otherwise the cc2630 hardfault immediately. Digging a bit, it seems the hardfault (invstate) occurs on the exit of the critical section in RF_scheduleCmd() (in contiki-ng/arch/cpu/simplelink-cc13xx-cc26xx/lib/coresdk_cc13xx_cc26xx/source/ti/drivers/rf/RFCC26XX_multiMode.c)

The actual call stack is something like (path from contiki-ng root directory):

- os/contiki-main.c:97 netstack_init();
-   os/net/netstack.c:90 NETSTACK_MAC.init(); (with NETSTACK_MAC being csma_driver for this chip)
-     os/net/mac/csma/csma.c:169 on();
-      os/net/mac/csma/csma.c:126 return NETSTACK_RADIO.on(); (with NETSTACK_RADIO being ieee-mode here)
-       arch/cpu/simplelink-cc13xx-cc26xx/rf/ieee-mode.c:666 res = netstack_sched_rx(true)
-         arch/cpu/simplelink-cc13xx-cc26xx/rf/sched.c:512 RF_CmdHandle tx_handle = RF_scheduleCmd([...]);
-           arch/cpu/simplelink-cc13xx-cc26xx/lib/coresdk_cc13xx_cc26xx/source/ti/drivers/rf/RFCC26XX_multiMode.c:4347 HwiP_restore(key);

and the hardfault is raised on this last call to HwiP_restore() (when executing the code step by step using a jlink jtag and the segger ozone debugger).

I've written a basic custom board based on the simplelink platform launchpad/cc2650, disabling as much devices as possible (push buttons, leds, etc), using the proper DEVICE=CC2630 var, disabling BLEm etc.

This error looks to me like an incorrectly initialized RF generating an invalid condition or event somehow (or incorrect configuration of the interrupts or exception handlers?), but I have now idea how to debug it further.I'm not even sure to understand what is the exact error condition that provokes this HardFault (these exception registers bits are set: HFSR.FORCED, UFSR.INVSTATE, SHCSR.PENDSVACT and CCR.STACKALIGN)

(FTR, if i comment the call to 'RF_scheduleCmd()' in this callstack, the execution does not crash immediately, but a few seconds later when RPL is trying to send a DIS).

So my question (which has already been asked but I did not see any valid response): is there an example **running** code activating the RF section for the CC2630? even not contiki based (I've used it because I found it to be much easier to get than CCS for which I still don't know which "product" I should use to start compile an hello-world program for this cc2630... The state of the developer documentation for these "old but still in production" chips is very frustrating; nothing actually usable from the CC2630 product page).

Thanks for any help/tip/suggestion,

David

  • You can try to refer to RF examples at dev.ti.com/.../node

  • Hi David,

    It should be possible to use a CC2650 RF radio example directly on your CC2630 without any modifications provided a supported radio PHY is selected.  Another option to consider is evaluating TIMAC.  Onw more recommendation is to test multiple boards (if possible) and submit your custom board design to SIMPLELINK-2-4GHZ-DESIGN-REVIEWS if you have any doubts about the hardware's performance. If the Contiki-NG solution is revealed to be the problem then you can further consult the Contiki-NG community

    Regards,
    Ryan

  • Thanks a lot both of you for your help.

    I am trying to find a path in all this, but it is pretty hard.

    I am working on a Debian Linux workstation.

    I've tried to use CCS (11) to compile a rf example (rfCarierWave) for the launchpad 2650 as suggested but I cannot even use the Resources Explorer (it's very slow, very buggy and does not display properly, I have the same problem for sysconf or AppCenter, aka any embedded app which is actually a web app/page, it seems):

    So I installed the standalone version of ti-rtos, and going in the examples directory I get:

    $ cd /opt/ti/tirtos_cc13xx_cc26xx_2_21_01_08/examples/TI/CC2650_LAUNCHXL/rfCarrierWave
    $ make
    Running Configuro...
    /bin/sh: 1: c:/ti/xdctools_3_32_00_06_core/xs: not found
    make: *** [makefile:53: rfExamples/linker.cmd] Error 127
    

    So I fixed the makedef file, because yeah, "c:/ti/" does not make much sense on linux...

    Then:

    $ make
    make
    Running Configuro...
    making package.mak (because of package.bld) ...
    js: "/opt/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/arm/elf/IArm.xs", line 79: Error: template generation of 'compiler.opt' failed: Error: Cannot find compiler in /opt/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS. Please check compiler path.
        "./package.bld", line 54
    gmake: *** Deleting file `package.mak'
    gmake: *** No rule to make target `.configuro'.  Stop.
    js: "/opt/ti/xdctools_3_32_00_06_core/packages/xdc/tools/Cmdr.xs", line 51: Error: xdc.tools.configuro: configuration failed due to earlier errors (status = 2); 'linker.cmd' deleted.
    make: *** [makefile:55: rfExamples/linker.cmd] Error 1
    

    So it seems the standalone ti-rtos actually depends on CCS v6 (!) being installed somewhere.

    I guess I need to search which file needs a another fix to make it use my currently installed ccs11 instead (will it work?), but jeez, this ecosystem is a nightmare.

    I usually use platformio for my embedded developments (I've used it for avr, stm32 and esp32 cpus using arduino, mbeb-os or native esp-idf frameworks) and it's night and day...

    Sorry for being so negative, but the experience for now with the ti dev ecosystem is very frustrating.

    Since I've finally could import the rfWaveCarrier example in CCS11, I'll give another try. For the record, here how the ccxml editor looks like:

    Anyway, I'll continue the fight, but yeah, not a great experience so far...

    David

  • I understand your frustration, as the CC2630 resources have not been updated or invested in for several years.  The TI-RTOS Release Notes do specify CCS 6.1.3 and Windows 7/8 or Ubuntu 10.04-13.04, among others.  You can find the legacy XDCTools on their Download page, although such an environment with CCS 11 has not been tested.  TI's ecosystem has focused on the SIMPLELINK-CC13XX-CC26XX-SDK in recent years, which I understand you cannot adopt due to the existing board dependency.  It would be worth migrating for a better experience with future projects.

    Regards,
    Ryan

  • Current status:

    I've finally been able to compile the rfCarrierWave above setting the MCU to CC2630 but with original rf_parameters (I had to fix the cc26x0f128.cmd file for this), and upload the firmware. I've not checked if it does anything at all for now (need to go near the spectrum analyzer for check for a signal).

    But I suspect it won't do much since the example code is using a proprietary rf config (which is not supported by the 2630 IIRC), so I need to find a better suited rf config.

    For this I've downloaded SmartRFStudio (which is windows only but at least works ok via wine).

    I've made a simple config (constant 2.4 GHz carrier), but the generated files won't compile because the compiler cannot find the rf_patches/rf_patch_cpe_ieee.h. And indeed, in /opt/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/rf_patches I have a few rf_path_cpe_xxx.h files (ble, ble_priv and genfsk) but no ieee...

    So I suspect the version of simplelink/cc26xxware/something expected by SmartRFStudio is not the one provided with ti-rtos (code exporter state that "The applied template is compatible with tirtos_simplelink_2_21_00" and I have tirtos_cc13xx_cc26xx_2_21_01_08 so it looks to me it should be ok; currently downloading ti-rtos 2.21.00.06 just in case).

    More traps.

  • Thanks Ryan,

    I know it's an old product, but I already have the boards, so I'd prefer to be able to reuse them as is than redesigning new ones (it's just for a hobby project TBH).

    What's frustrating is the inconsistency and outdated information one needs to look for everywhere, and the fact the chips is advertised as still produced and supported by many tools but actually since it's not tested, it does not work any more (hello CI).

    Anyway I've made progress since I've at last been able to make this board generate a tone:

    I stole the missing rf_patch_ieee.h file from contiki's source repo and with only minor modifications of the code, it compiled and it even seem to work.

  • It seems that rf_patch_cpe_ieee.h existed on some earlier versions of SimpleLink SDKs: https://e2e.ti.com/f/1/t/801640 

    Regards,
    Ryan