Questions and discussions about the software that runs on the TD RF module itself.
zeliuq
 
Posts: 7
Joined: Mon Jul 06, 2015 7:57 am

TD_SIGFOX_Send function crashes after 21836 mgs

by zeliuq Tue Oct 20, 2015 11:49 am

After sending 21836 messages the TD_SIGFOX_Send function crashes.
This is a reproducible error. I have tried with different source codes, modules (TD1204) and different message sizes and the TD crashes every time after the same number of transmissions.
Either while loops or the scheduler for iterative sending have the same behaviour.
You can find some sample code at the end of the post.
I have also tried longer intervals (15 seconds) between transmissions with the same result.

The error message is (where the first sequence of numbers refers to the message counter):

21827
21828
21829
21830
21831
21832
21833
21834
21835
21836
[TRAP] Time:1.01:22:58.278 : 13:Radio Chip | Param:0x00000014(20)
-- TRAP DUMP --
MSP:0x20001EB0
HardFaultSt:0x00000000
FaultStatus:0x00000000:Stack:0x20001940-0x20002120
-- TRAP Trace@0x20000000 --
Trace stack truncated
Var 0:183
Var 1:135
Var 2:158
Var 3:123
Var 4:63
Var 5:255
Var 6:79
Var 7:114
Var 8:221
-Stack trace-
0|0x0000489D
1|0x00004699
2|0x000025F3
3|0x00000BD7
4|0x00004AAD
5|0x00000CB5
6|0x000019A1
7|0x00001989
8|0x000005D1
9|0x00003E33
10|0x00000EC7
11|0x0000058D
12|0x000016CD
13|0x0000058D
14|0x00001753
15|0x0000554D
16|0x0000024B
17|0x00005A6F
18|0x00005A21

Sample code to reproduce the error as follows:

void TD_USER_Setup(void)
{
uint32_t counter = 0;
int i;
uint8_t message[12];

// Define the LED pin as an output in push-pull mode
GPIO_PinModeSet(LED_PORT, LED_BIT, gpioModePushPull, 0);

// Initialize the LEUART
init_printf(TD_UART_Init(9600, true, true),
TD_UART_Putc,
TD_UART_Start,
TD_UART_Stop);

// Build hex message
for (i = 0; i < 12; i++) {
message[i] = i;
}

tfp_printf("Chasing bug 21836...\r\n", counter);

while(true)
{
// Send hex message with 2 repetitions
GPIO_PinOutSet(LED_PORT, LED_BIT);
//TD_SIGFOX_Send(message, 12, 2);
TD_SIGFOX_Send(message, 1, 2);
GPIO_PinOutClear(LED_PORT, LED_BIT);

tfp_printf("%d\r\n", counter);

// Wait a bit
TD_RTC_Delay(T100MS);

counter++;
}
}
User avatar
mstempin
 
Posts: 168
Joined: Thu May 07, 2015 9:24 am

Re: TD_SIGFOX_Send function crashes after 21836 mgs

by mstempin Fri Oct 23, 2015 9:37 am

Bug confirmed: 21836 * 3 frames = 65508, very close to 65536 (maximum 16 bit unsigned integer value), causing one 16-bit unsigned integer TCXO power-up counter to overflow in libtdrf.a.

However, this value can be mitigated, depending on the paths taken by the code and was not observed during our extensive tests.

Thank you for your detailed report, we will release a hotfix for this problem asap!
zeliuq
 
Posts: 7
Joined: Mon Jul 06, 2015 7:57 am

Re: TD_SIGFOX_Send function crashes after 21836 mgs

by zeliuq Fri Nov 13, 2015 9:09 am

Any idea when this bug will be solved?

I think it is really urgent, no product can be trusted if it is going to block every 7 months.

Meanwhile is there any way to go around it or, at least, enable the device to reset by itself once blocked? I have done a first temptative with the watchdog and it did not work.

Thank you for your support,
Rob
nestorayuso
 
Posts: 6
Joined: Thu May 07, 2015 12:48 pm
Location: Spain

Re: TD_SIGFOX_Send function crashes after 21836 mgs

by nestorayuso Tue Nov 24, 2015 10:25 am

One month after the bug was discovered, it is fixed.

Update your repository to get the new libtdrf.a
Return to Firmware

Who is online

Users browsing this forum: No registered users and 1 guest