Skip to content

Commit 2cee62e

Browse files
committed
Merge pull request #1074 from g-oikonomou/cc26xx/contrib/new-cc26xxware
Update to latest CC26xxware and add it as a submodule
2 parents 36d5c5d + b861b8f commit 2cee62e

20 files changed

+79
-150
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "tools/cc2538-bsl"]
55
path = tools/cc2538-bsl
66
url = https://github.com/JelmerT/cc2538-bsl.git
7+
[submodule "cpu/cc26xx/lib/cc26xxware"]
8+
path = cpu/cc26xx/lib/cc26xxware
9+
url = https://github.com/g-oikonomou/cc26xxware.git

.travis.yml

-7
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@ before_script:
4949
arm-none-eabi-gcc --version ;
5050
fi
5151

52-
## Download and extract cc26xxware
53-
- if [ ${BUILD_ARCH:-0} = arm-aapcs ] ; then
54-
wget http://www.ti.com/lit/sw/swrc296/swrc296.zip &&
55-
unzip swrc296.zip &&
56-
export TI_CC26XXWARE=cc26xxware_2_20_06_14829 ;
57-
fi
58-
5952
## Install RL78 GCC toolchain
6053
- sudo apt-get install libncurses5:i386 zlib1g:i386
6154
- $WGET http://adamdunkels.github.io/contiki-fork/gnurl78-v13.02-elf_1-2_i386.deb &&

cpu/cc26xx/Makefile.cc26xx

+10-19
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,24 @@ NM = arm-none-eabi-nm
88
SIZE = arm-none-eabi-size
99
SREC_CAT = srec_cat
1010

11-
### TI CC26xxware out-of-tree
12-
### TI_CC26XXWARE is the home directory of the cc26xxware
13-
### It MUST be provided as a path relative to $(CONTIKI)
14-
### For example, if
15-
### CONTIKI = /home/user/contiki
16-
### and TI_CC26XXWARE is stored in
17-
### /home/user/cc26xxware
18-
### then set
19-
### TI_CC26XXWARE = ../cc26xxware
20-
ifndef TI_CC26XXWARE
21-
$(error TI_CC26XXWARE not defined. Please see the README)
22-
endif
11+
CPU_ABS_PATH = cpu/cc26xx
12+
TI_CC26XXWARE_PATH = lib/cc26xxware
13+
TI_CC26XXWARE = $(CONTIKI_CPU)/$(TI_CC26XXWARE_PATH)
2314

24-
### cc26xxware sources will be added to the MODULES list
25-
TI_CC26XXWARE_SRC = $(TI_CC26XXWARE)/driverlib
15+
### cc26xxware sources under driverlib will be added to the MODULES list
16+
TI_CC26XXWARE_SRC = $(CPU_ABS_PATH)/$(TI_CC26XXWARE_PATH)/driverlib
2617

2718
### The directory with startup sources will be added to the CONTIKI_CPU_DIRS
2819
### and the sources therein are added to the sources list explicitly. They are
2920
### also listed explicitly in the linker command (through TARGET_STARTFILES),
3021
### to make sure they always get linked in the image
31-
TI_CC26XXWARE_STARTUP = ../../$(TI_CC26XXWARE)/startup_files
22+
TI_CC26XXWARE_STARTUP_DIR = $(TI_CC26XXWARE_PATH)/startup_files
3223
TI_CC26XXWARE_STARTUP_SRCS = ccfg.c startup_gcc.c
3324

34-
### MODULES will add some of these to the include pach, but we need to add
25+
### MODULES will add some of these to the include path, but we need to add
3526
### them earlier to prevent filename clashes with Contiki core files
36-
CFLAGS += -I$(CONTIKI)/$(TI_CC26XXWARE) -I$(CONTIKI)/$(TI_CC26XXWARE_SRC)
37-
CFLAGS += -I$(CONTIKI)/$(TI_CC26XXWARE)/inc
27+
CFLAGS += -I$(TI_CC26XXWARE) -I$(CONTIKI)/$(TI_CC26XXWARE_SRC)
28+
CFLAGS += -I$(TI_CC26XXWARE)/inc
3829
MODULES += $(TI_CC26XXWARE_SRC)
3930

4031
LDSCRIPT = $(CONTIKI_CPU)/cc26xx.ld
@@ -71,7 +62,7 @@ endif
7162
CLEAN += symbols.c symbols.h *.d *.elf *.hex
7263

7364
### CPU-dependent directories
74-
CONTIKI_CPU_DIRS = . dev dev/rfc-api $(TI_CC26XXWARE_STARTUP)
65+
CONTIKI_CPU_DIRS = . dev dev/rfc-api $(TI_CC26XXWARE_STARTUP_DIR)
7566

7667
### Use the existing debug I/O in cpu/arm/common
7768
CONTIKI_CPU_DIRS += ../arm/common/dbg-io

cpu/cc26xx/cc26xx.ld

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ ENTRY(ResetISR)
3535

3636
MEMORY
3737
{
38-
/* Flash Size 128 KB minus the CCA area below (76 bytes) */
39-
FLASH (RX) : ORIGIN = 0x00000000, LENGTH = 0x0001FFAC
38+
/* Flash Size 128 KB minus the CCA area below (88 bytes) */
39+
FLASH (RX) : ORIGIN = 0x00000000, LENGTH = 0x0001FFA8
4040

4141
/*
4242
* Customer Configuration Area and Bootloader Backdoor configuration
43-
* in flash, up to 80 bytes
43+
* in flash, up to 88 bytes
4444
*/
45-
FLASH_CCFG (RX) : ORIGIN = 0x0001FFAC, LENGTH = 84
45+
FLASH_CCFG (RX) : ORIGIN = 0x0001FFA8, LENGTH = 88
4646

4747
/* RAM Size 20KB (PG2.1) */
4848
SRAM (RWX) : ORIGIN = 0x20000000, LENGTH = 0x00005000

cpu/cc26xx/dev/batmon-sensor.c

+4-8
Original file line numberDiff line numberDiff line change
@@ -61,28 +61,25 @@ static int enabled = SENSOR_STATUS_DISABLED;
6161
* \brief Returns a reading from the sensor
6262
* \param type BATMON_SENSOR_TYPE_TEMP or BATMON_SENSOR_TYPE_VOLT
6363
*
64-
* \return The raw sensor reading, not converted to human-readable form
64+
* \return The value as returned by the respective CC26xxware function
6565
*/
6666
static int
6767
value(int type)
6868
{
69-
uint32_t tmp_value;
70-
7169
if(enabled == SENSOR_STATUS_DISABLED) {
7270
PRINTF("Sensor Disabled\n");
7371
return 0;
7472
}
7573

7674
if(type == BATMON_SENSOR_TYPE_TEMP) {
77-
tmp_value = ti_lib_aon_batmon_temperature_get();
75+
return (int)ti_lib_aon_batmon_temperature_get_deg_c();
7876
} else if(type == BATMON_SENSOR_TYPE_VOLT) {
79-
tmp_value = ti_lib_aon_batmon_battery_voltage_get();
77+
return (int)ti_lib_aon_batmon_battery_voltage_get();
8078
} else {
8179
PRINTF("Invalid type\n");
82-
return 0;
8380
}
8481

85-
return (int)tmp_value;
82+
return 0;
8683
}
8784
/*---------------------------------------------------------------------------*/
8885
/**
@@ -101,7 +98,6 @@ configure(int type, int enable)
10198
switch(type) {
10299
case SENSORS_HW_INIT:
103100
ti_lib_aon_batmon_enable();
104-
ti_lib_aon_batmon_measurement_cycle_set(AON_BATMON_CYCLE_32);
105101
enabled = SENSOR_STATUS_ENABLED;
106102
break;
107103
case SENSORS_ACTIVE:

cpu/cc26xx/dev/cc26xx-uart.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,7 @@ configure(void)
154154
BOARD_IOID_UART_CTS, BOARD_IOID_UART_RTS);
155155

156156
/* Configure the UART for 115,200, 8-N-1 operation. */
157-
ti_lib_uart_config_set_exp_clk(UART0_BASE,
158-
ti_lib_sys_ctrl_peripheral_clock_get(
159-
PRCM_PERIPH_UART0,
160-
SYSCTRL_SYSBUS_ON),
157+
ti_lib_uart_config_set_exp_clk(UART0_BASE, ti_lib_sys_ctrl_clock_get(),
161158
CC26XX_UART_CONF_BAUD_RATE,
162159
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
163160
UART_CONFIG_PAR_NONE));

cpu/cc26xx/lib/cc26xxware

Submodule cc26xxware added at 420ae36

cpu/cc26xx/lpm.c

+6-14
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,9 @@ lpm_shutdown(uint32_t wakeup_pin, uint32_t io_pull, uint32_t wake_on)
141141
ti_lib_aon_wuc_mcu_power_down_config(AONWUC_NO_CLOCK);
142142
ti_lib_aon_wuc_aux_power_down_config(AONWUC_NO_CLOCK);
143143

144-
/* Disable retentions: SRAM, CPU, AUX, RFCORE - possibly not required */
144+
/* Disable SRAM and AUX retentions */
145145
ti_lib_aon_wuc_mcu_sram_config(0);
146-
ti_lib_prcm_retention_disable(PRCM_DOMAIN_CPU);
147146
ti_lib_aon_wuc_aux_sram_config(false);
148-
ti_lib_prcm_retention_disable(PRCM_DOMAIN_RFCORE);
149147

150148
/*
151149
* Request CPU, SYSBYS and VIMS PD off.
@@ -160,7 +158,7 @@ lpm_shutdown(uint32_t wakeup_pin, uint32_t io_pull, uint32_t wake_on)
160158
/* Turn off AUX */
161159
ti_lib_aux_wuc_power_ctrl(AUX_WUC_POWER_OFF);
162160
ti_lib_aon_wuc_domain_power_down_enable();
163-
while(ti_lib_aon_wuc_power_status() & AONWUC_AUX_POWER_ON);
161+
while(ti_lib_aon_wuc_power_status_get() & AONWUC_AUX_POWER_ON);
164162

165163
/*
166164
* Request MCU VD power off.
@@ -176,7 +174,7 @@ lpm_shutdown(uint32_t wakeup_pin, uint32_t io_pull, uint32_t wake_on)
176174
ti_lib_pwr_ctrl_io_freeze_enable();
177175

178176
/* Turn off VIMS cache, CRAM and TRAM - possibly not required */
179-
ti_lib_prcm_retention_disable(PRCM_DOMAIN_VIMS);
177+
ti_lib_prcm_cache_retention_disable();
180178
ti_lib_vims_mode_set(VIMS_BASE, VIMS_MODE_OFF);
181179

182180
/* Enable shutdown and sync AON */
@@ -216,7 +214,7 @@ wake_up(void)
216214

217215
/* Turn on cache again */
218216
ti_lib_vims_mode_set(VIMS_BASE, VIMS_MODE_ENABLED);
219-
ti_lib_prcm_retention_enable(PRCM_DOMAIN_VIMS);
217+
ti_lib_prcm_cache_retention_enable();
220218

221219
ti_lib_aon_ioc_freeze_disable();
222220
ti_lib_sys_ctrl_aon_sync();
@@ -340,15 +338,9 @@ lpm_drop()
340338
ti_lib_aon_wuc_mcu_sram_config(MCU_RAM0_RETENTION | MCU_RAM1_RETENTION |
341339
MCU_RAM2_RETENTION | MCU_RAM3_RETENTION);
342340

343-
/* Enable retention on the CPU domain */
344-
ti_lib_prcm_retention_enable(PRCM_DOMAIN_CPU);
345-
346341
/* Disable retention of AUX RAM */
347342
ti_lib_aon_wuc_aux_sram_config(false);
348343

349-
/* Disable retention in the RFCORE RAM */
350-
ti_lib_prcm_retention_disable(PRCM_DOMAIN_RFCORE);
351-
352344
/*
353345
* Always turn off RFCORE, CPU, SYSBUS and VIMS. RFCORE should be off
354346
* already
@@ -362,7 +354,7 @@ lpm_drop()
362354
/* Turn off AUX */
363355
ti_lib_aux_wuc_power_ctrl(AUX_WUC_POWER_OFF);
364356
ti_lib_aon_wuc_domain_power_down_enable();
365-
while(ti_lib_aon_wuc_power_status() & AONWUC_AUX_POWER_ON);
357+
while(ti_lib_aon_wuc_power_status_get() & AONWUC_AUX_POWER_ON);
366358

367359
/* Configure the recharge controller */
368360
ti_lib_sys_ctrl_set_recharge_before_power_down(false);
@@ -389,7 +381,7 @@ lpm_drop()
389381
* until right before deep sleep to be able to use the cache for as long
390382
* as possible.
391383
*/
392-
ti_lib_prcm_retention_disable(PRCM_DOMAIN_VIMS);
384+
ti_lib_prcm_cache_retention_disable();
393385
ti_lib_vims_mode_set(VIMS_BASE, VIMS_MODE_OFF);
394386

395387
/* Deep Sleep */

0 commit comments

Comments
 (0)