Once programmed, your App is stored in NVRAM by the minidriver and will be automatically loaded to internal RAM (bootloader not required) on boot up and initialized.
Specifically, the application runs in its own thread and the entire application framework is event driven. The main entry point of the application is APPLICATION_INIT() where it has to register its GATT database, configurations and the application create function (no other operations are allowed at this point).
Once this is done, the rest of the firmware and the BLE stack will be initialized - and once these are ready - the application create function will be invoked.
Once you return from this function, everything is event driven and callbacks for connection up/down/end of ADV interval/write to GATT handle, interrupts, timer expiry etc. are all events for the application to handle.
Also remember that When sampled on RESET only:
HCI UART Rx = High (Programming mode)
HCI UART Rx = Low (Application mode)
One more question:
I find SDA always connect to key in your reference design, it seems a boot mode key. What do it use for? NVRAM recover mode?
BTW, in WICED SENSE KIT, CP2105 support 2 UART: UP_TX/UP_RX & RXD_SCI/TXD_SCI/CTS_SCI/RTS_SCI. I guess UP_TX/IP_RX is for programming/application communication, but I don't understand SCI UART, it's for debuging or another peripheral? May I send debug info to PC SDK through HCI UART?
1 of 1 people found this helpful
> I find SDA always connect to key in your reference design, it seems a boot mode key. What do it use for? NVRAM recover mode?
Yes, this is for recovery. This is useful only during development. Once you decide to go into mass production, you don't need the recovery mechanism because the FW you are going to download to the NV in the factory should be stable and will not brick the device.
UP_RX/TX is for download. One of the GPIO options of the peripheral uart is connected to the second instance of the USB-UART bridge.