stm32 rtems_counter_delay_nanoseconds() longer

Jython googcheng at gmail.com
Sun Jun 30 06:36:55 UTC 2019


a 21ms counter in fact more than 10s, see log , my rtc 10s wake up

static void Delay_ms(x)
{
    #if 0
    int int_num = 0;

    if(x % 10 == 0)
    {
        int_num = x / 10;
    }
    else
    {
        int_num = x / 10 + 1;
    }
    //printf("delay x %d int_num %d\n", x, int_num);
    rtems_task_wake_after(int_num);
    #endif
    volatile int i;
    int us_cnt = 1000*x;
    printf("delay x %dms us_cnt %d\n", x, us_cnt);
    for(i = 0; i < us_cnt; i++)
        rtems_counter_delay_nanoseconds(1000);

    printf("end delay\n");
}


[14:33:18.242]ÊÕ¡û¡ôflash_buf 32 00 00 00
write page index 50
log_page_no = 50
before while
loop begin
dtr set 0
baud 9600 at UART1_ChangeBaud
USART_WordLength_8b
USART_StopBits_1
delay x 21ms us_cnt 21000

[14:33:21.055]ÊÕ¡û¡ôafter clr isr 00000033

[14:33:31.056]ÊÕ¡û¡ôafter clr isr 00000033

[14:33:32.759]ÊÕ¡û¡ôend delay
Lenggui_ClrBuffer begin okflag 0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20190630/0074673a/attachment.html>


More information about the users mailing list