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


