W801 platform BLE Debugging problem

Publish in 2023-02-14 11: 41: 10

In use W801 platform Demo Board debugging BLE when, encountered FreeRToS System related problems, Refer to NimBLE Open source library, operational SDK The version is W80X_SDK_v1. 00. 10.
The project development requirement is to add Bluetooth physical switch buttons, I added it myself BLE The key control logic code is as follows:
(Initialize here BLE On by default, Actually use instruction testing or delay testing API The call is fine, But interrupting the test with a key is problematic, Debug logs are as follows, Please also help find the cause! )

static void ble_gpio_isr_callback (void *context) 
{
    u8 ret = 0; 

    ret = tls_get_gpio_irq_status (BLE_BUTTON_GPIO) ; 

    if  (ret) 
    {
        printf ("ble button interrupt happen! \n") ; 
        tls_clr_gpio_irq_status (BLE_BUTTON_GPIO) ; 
        ble_button_check () ; 
    }

    return; 
}

void ble_button_init (void) 
{
    tls_gpio_cfg (BLE_BUTTON_GPIO,  WM_GPIO_DIR_INPUT,  WM_GPIO_ATTR_PULLHIGH) ; 
    tls_gpio_isr_register (BLE_BUTTON_GPIO,  ble_gpio_isr_callback,  NULL) ; 
    tls_gpio_irq_enable (BLE_BUTTON_GPIO,  WM_GPIO_IRQ_TRIG_LOW_LEVEL) ; 

    ble_init () ; 

    return; 
}

void ble_init (void) 
{
    u8 ret = 0; 
            
    ret = tls_gpio_read (BLE_BUTTON_GPIO) ; 
    printf ("ble button check status value =%d\n", ret) ; 

    if  (ret) 
    {
        demo_bt_enable () ; 
        tls_os_time_delay (1000) ; 
        demo_ble_server_on () ; 
    }

    return; 
}

void ble_button_check (void) 
{
    u8 ret = 0; 
            
    ret = tls_gpio_read (BLE_BUTTON_GPIO) ; 
    printf ("button check status value =%d\n", ret) ; 

    if  (ret) 
    {
        demo_bt_enable () ; 
        tls_os_time_delay (1000) ; 
        demo_ble_server_on () ; 
    }
    else
    {
        demo_bt_destroy () ; 
    }

    return; 
}

FD3D60D7-7B7C-4245-8DB7-4352B21230D0. png
C6BD5F57-E642-447a-BAD1-98F2893E5DCD. png

See more

follower
0
Be viewed
2. 4k
1 Multiple replies
isme
isme Certified specialist 2023-02-14
Chilled big watermelon

Cannot enable Bluetooth operation in interrupt, Do things that are complicated and time-consuming, The correct logic is that an interrupt is just a semaphore, Receive the semaphore in the task to perform the corresponding time-consuming operations.

Write an answer

Please login to post your answer, Click to log in

publish
problem

Share
Friend

Cell phone
browse

Scan code mobile browsing