LinkIt One: vm_timer_create_precise fails

Moderators: lily.li, violet, salmanfarisvp

Post Reply
aaron243
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Sun Nov 24, 2019 5:37 am

LinkIt One: vm_timer_create_precise fails

Post by aaron243 » Sun Nov 24, 2019 9:34 am

Hi! I'm trying to get an example from the CodeLite For RePhone to work, but vm_timer_create_precise() fails. It works on the RePhone device, but when I port it to a LinkIt One, I get the following debugging output on the UART:
Hello from vm_main
gpio_init: begin
gpio_init: end
end of vm_main
handle_sysevt: begin
VM_EVENT_CREATE
create timer fail: -103
handle_sysevt: end
handle_sysevt: begin
Other VM_EVENT_ -1073754168
1
handle_sysevt: end
handle_sysevt: begin
Other VM_EVENT_ -1073754168
17
handle_sysevt: end
Here's the code from where vm_timer_create_precise is called:

Code: Select all

void handle_sysevt( VMINT message, VMINT param )
{
  char errSt[100];
  my_uart_log( "handle_sysevt: begin\n" );
  switch( message ) {
    case VM_EVENT_CREATE:
      my_uart_log( "  VM_EVENT_CREATE\n" );
      sys_timer_id = vm_timer_create_precise( 1000, (vm_timer_precise_callback)sys_timer_callback, NULL );
      if( sys_timer_id < 0) {
        sprintf( errSt, "%s %d\n", "create timer fail:", sys_timer_id );
        my_uart_log( errSt );
      }
      break;
    case VM_EVENT_QUIT:
      my_uart_log( "  VM_EVENT_QUIT\n" );
      break;
    default:
      sprintf( errSt, "%s %d\n", "  Other VM_EVENT_ %d\n", message );
      my_uart_log( errSt );
  }
  my_uart_log( "handle_sysevt: end\n" );
}
I believe I have the latest libraries - from 2014, it appears. Any idea why this fails on the LinkIt One?

Curiously, a similar example using vm_thread_create works. The firmware on the LinkIt One was updated.

Post Reply