Port a TD1208 firmware to TD1508


TD1508 is the FCC version of the TD1208, they are pin to pin compatible and based on the same SDK so converting an object working on a TD1208 sounds easy. Practically speaking there are some preparing steps because of some tiny bugs to solve.

Let see how to port a Telecom Design existing firmware for TD1208 to TD1508 (from ETSI to FCC).



Compile the library for EZR

You first have to rename a file :

Rename a file


The file startup_efm32lg.s have to be renamed to startup_efm32lg.S if you do it directly from the file system don’t forget to refresh the folder in the Project Explorer.





Then as the chip in TD1508 is an Energy Micro EZR, so you need to recompile the library for this target:

You have to do it for all the libraries :

Lib you need to recompile with EZR target

Once done your project is ready to be recompiled.

Adapt the build settings

In the project template I have the TD1508 have its variable set to TD1208 value, so you can check this and fix it here:

Ensure the module revision setting is correct

Adapt your software


I2C pins are different so you have to adapt your I2C init.

    #define    I2C_SCL_PORT    gpioPortE
    #define I2C_SCL_BIT        1
    #define I2C_SDA_PORT    gpioPortE
    #define I2C_SDA_BIT        0
    #define    I2C_SCL_PORT    SCL_PORT
    #define I2C_SCL_BIT        SCL_BIT
    #define I2C_SDA_PORT    SDA_PORT
    #define I2C_SDA_BIT        SDA_BIT

void my_I2C_Init_(void) {

    CMU_ClockEnable(cmuClock_GPIO, true);
    CMU_ClockEnable(cmuClock_I2C1, true);
    CMU_ClockEnable(cmuClock_I2C0, true);

    GPIO_PinModeSet(I2C_SCL_PORT, I2C_SCL_BIT,gpioModeWiredAnd,1);
    GPIO_PinModeSet(I2C_SDA_PORT, I2C_SDA_BIT,gpioModeWiredAnd,1);    

    I2C_Init_TypeDef i2cInit = I2C_INIT_DEFAULT;

    I2C_Init(I2C1, &i2cInit);
    // NVIC_ClearPendingIRQ(I2C1_IRQn);  // uncomment if you are using IRQ
    // NVIC_EnableIRQ(I2C1_IRQn);
    I2C_Init(I2C0, &i2cInit);
    // NVIC_ClearPendingIRQ(I2C0_IRQn);  // uncomment if you are using IRQ
    // NVIC_EnableIRQ(I2C0_IRQn);

Do not forget to also update your I2C read/write procedure and replace the I2C0 bus to I2C1 bus like this :

#define IC2BUS    I2C1
#define IC2BUS    I2C0

    i2cTransfert.buf[1].len = 2;
    _status = I2C_TransferInit(IC2BUS, &i2cTransfert);
    while ( _status == i2cTransferInProgress) {
       _status = I2C_Transfer(IC2BUS);

Radio Power

With a transmission at 24dB the power needed will be 240mA, time is shorter but consumption really higher. You have to ensure your object power supply can support a such peak. If not you need to limit the transmission power.

Consumptions are :

Tx Power Vcc Power
15dB 135mA
20dB 180mA
22dB 200mA
23dB 230mA
24dB 240mA

To select the right transmission power you can use the following function


You add as parameter the power in dB you want to use. According to the User Manual, I assume you can only choose 15,20,22,23,24dB.

Configure sigfox

The version 6.3.4 of the SDK have some bug on Sigfox configuration for FCC, so you need to manually call some functions on init to configure Sigfox communications on FCC. Only need to be called once.

uint32_t sigfox_fcc_macro_channel_bitmask[3];
sigfox_fcc_macro_channel_bitmask[0] = CONFIG_SIGFOX_FCC_MACRO_CHANNEL_BITMASK_LSB;
sigfox_fcc_macro_channel_bitmask[1] = CONFIG_SIGFOX_FCC_MACRO_CHANNEL_BITMASK_MID;
sigfox_fcc_macro_channel_bitmask[2] = CONFIG_SIGFOX_FCC_MACRO_CHANNEL_BITMASK_MSB;


Program the chip

With a JLink programmer you can use the following command to initiate the right chip:

# JLinkExe -device EZR32LG230F128 -if swd -speed 1000

Actually the Windows loader is not able to program the chip but you can program over the serial port with product ID = 31

./cflash -d /dev/ttyUSBx -b 115200 -p 31 firmware.bin

Still missing

According to the forum the chip have to be rebooted every 2 frame to work with sigfox network in USA, looking forward to find a workaround.

This entry was posted in Hardware and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *