Hi everyone,
I downloaded the project B85M_SINGLE_BLE_SDK.
This is my first time using Telink processors.
At the beginning I decided to prepare a program that would only set the state to GPIO PC4. I selected b85m_ble_sample and modified the main.c file. Now it looks like this:
_attribute_ram_code_ int main (void){
cpu_wakeup_init();
clock_init(SYS_CLK_24M_Crystal);
irq_disable();
// gpio_init(1);
gpio_set_func(GPIO_PC4, AS_GPIO);
gpio_set_output_en(GPIO_PC4, 1);
gpio_set_input_en(GPIO_PC4, 0);
gpio_write(GPIO_PC4, 1);
while (1) {
// main_loop ();
}
}
After generating the .BIN file, I upload it to the Flash memory using the BDT tool. My settings:
B85, EVK, Settings Flash default
I open the previously generated .BIN file
I press the Download button:
[12:31:35]:
TC32 EVK : Swire OK
Flash Sector (4K) Erase at address 0
Flash Page Program at address 0
Flash Page Program at address 400
Flash Page Program at address 800
Flash Page Program at address c00
Flash Sector (4K) Erase at address 1000
Flash Page Program at address 1000
Flash Page Program at address 1400
Flash Page Program at address 1800
Flash Page Program at address 1c00
Flash Sector (4K) Erase at address 2000
Flash Page Program at address 2000
Flash Page Program at address 2400
Flash Page Program at address 2800
Flash Page Program at address 2c00
Flash Sector (4K) Erase at address 3000
Flash Page Program at address 3000
Flash Page Program at address 3400
Flash Page Program at address 3800
Flash Page Program at address 3c00
Flash Sector (4K) Erase at address 4000
Flash Page Program at address 4000
Flash Page Program at address 4400
Flash Page Program at address 4800
Flash Page Program at address 4c00
File Download to Flash at address 0x000000: 19508 bytes
Total Time: 1280ms
[12:31:41]:
reset mcu
After performing a reset, the state of the PC4 pin does not change. I still have 1.8V there.
explanation:
gpio_write(GPIO_PC4, 1); is only example.
I also tried gpio_write(GPIO_PC4, 0); but with the same result
How should I prepare and upload the program correctly? Please help
Hi,
Please start with driver SDK http://wiki.telink-semi.cn/tools_and_sdk/Driver/telink_b85m_driver_sdk.zip GPIO demo,and you should init your code in user_app.c,not in main function when using B85M_SINGLE_BLE_SDK.