configuration change when the code have run

5 posts / 0 new
Last post
YuanhangWu
Offline
Last seen:4 years 10 months ago
Expert
加入:2015-03-25 08:19
configuration change when the code have run

Hi,all,

In project DSPS 3.150.2 peripheral.
I have close sleep and close flow control .

I want to change configuration when the code have run,
configuration need to been chang is: baudrate, the MAC.

I have try to realize this goal.but is not get success.
get start baudrate is 115K200 ,the set is :
uart_sps_init(9, 3); //#define UART_BAUDRATE_115K2 9
in function
void periph_init();
then in code ,I set
uart_sps_init(17 , 3); //#define UART_BAUDRATE_57K6 17
but the baudrate is not changed,and the UART function is not work,because is not print information any more.

The mac i have change in function
void nvds_read_bdaddr_from_otp()
memcpy(&dev_bdaddr, BD_ADDR_ARRY, 6); //BD_ADDR_ARRY is my MAC
我停止广告你se app_adv_stop(),
then Start Advertising use app_adv_start(void);
But the MAC is not changed because the phone scan result is not change.
So,i used app_reset_app(); but also not make it.

please help me.

thanks.

Device:
YuanhangWu
Offline
Last seen:4 years 10 months ago
Expert
加入:2015-03-25 08:19
Hi,all,

Hi,all,

I want to change baudrate, the MAC,,the two configuration when the code have run. but cannot make it.

Is me did not describe it clearly?

Can you help me?
thanks.

MT_dialog
Offline
Last seen:1 month 1 week ago
Staff
加入:2015-06-08 11:34
Hi Yuanhang,

Hi Yuanhang,

When you say MAC you i suppose that you mean the BD address. Since you ve issued a GAPM_RESET the db address changing should have worked. You can try to change your bd address in the custom_nvds_get function. I ve tried this, and issued a app_reset_app() from a button, incremented the bd address each time the device was reseted and return an increasing number of bd addresses. Try setting the new UART configuration (uart_sps_init(17, 3);) in the app_init_function() change the value of the terminal in 57600 and give it a try.

Thanks MT_dialog

YuanhangWu
Offline
Last seen:4 years 10 months ago
Expert
加入:2015-03-25 08:19
Hi,MT_dialog,

Hi,MT_dialog,
I have try as you suggested ,and test the set configuration is pass.

Thanks MT_dialog.

MT_dialog
Offline
Last seen:1 month 1 week ago
Staff
加入:2015-06-08 11:34
Hi YuanhangWu,

Hi YuanhangWu,

No problem, glad it worked.

Thanks MT_dialog

Topic locked