how to bt_disable in NCS2.0.x?

Hello,

nRF5340+nRF21540, NCS2.0.2, vscode.

void go_system_off(void)
{
    printk("%s system off \n", CONFIG_BOARD);
    nrf_gpio_cfg_input(NRF_DT_GPIOS_TO_PSEL(DT_NODELABEL(button0), gpios),NRF_GPIO_PIN_PULLUP);
    nrf_gpio_cfg_sense_set(NRF_DT_GPIOS_TO_PSEL(DT_NODELABEL(button0), gpios),NRF_GPIO_PIN_SENSE_LOW);
 
    pm_state_force(0, &si);
    k_msleep(100);
}
void main(void)
{
    int err = bt_enable(NULL);
    if (err) {
        printk("Bluetooth init failed (err %d)\n", err);
        return;
    }
    err=bt_disable();// return  0xFFFFFF7A
    printk("hello world! %X\n",err);
    go_system_off();
}
sleep mode take 433uA,
if don't do  bt_enable(),  it take 20uA
why?
    
Best regards
  • Hi,

    Sorry for not getting back to you sooner.

    yoyou said:
    CONFREG0
    0x7D=1111101 (TX_GAIN=31, POUTA=20dB,TX=en)
    when GPIO MODE , no connect  SPI to 21540,
    how to write CONFREG0 to max power?

    To write to CONFREG0 the a SPI connection is needed. With GPIO only the register cant be written to.

    yoyou said:
    pins:
    tx-en       set logic high,  enabled
    rx-en       set logic low,   disabled
    ant-sel     set logic low or connect to GND, use ANT1
    mode       set logic low,   POUTA=20dB
    above is means  (TX_GAIN=31, POUTA=20dB,TX=en,RX=disabed)  ?

    Yes, this pin configuration will give 20dBm output power in TX mode.

     

    Best regards,

    Bendik

Related