Nine new posts / 0
The Last post
Ye Kinson
Offline
Last seen:4 years 10 have a line
Joined:The 2016-09-07 08:14
Questions about the MAC

Hello!
I think through the app I hope the MAC address of the send to 14580 and then stored in external SPI flash, next time you start, use the new MAC address.Then where I need a new MAC dev_bdaddr assignment?thank you

Device:
Gongyu_Dialog
Offline
Last seen:1 day 15 hours a line
Joined:The 2016-04-27 07:07
Chip electric take address process is as follows:

Chip electric take address process is as follows:
Find system_init function
1. 580 to electricity will first read the address from the OTP endures dev_bdaddr, function process nvds_read_bdaddr - > nvds_read_bdaddr_from_otp
2. Rwip_init function, this function because BLE_HOST_PRESENT defines, so running is the version of ROM, is not a function of the same name in the SDK.
3. Inside the rwip_init function, can call to rwble_init - > lld_init (false) / / false representative do not need to be reset
4. Lld_init function will be called jump_table_base lld_init_func function
5. Lld_init_func invoked inside nvds_get function to get the NVDS_TAG_BD_ADDRESS bluetooth address.Get the address is finally equipment is used.
The corresponding SDK nvds_get custom_nvds_get_func jump_table in the code.
6. Custom_nvds_get_func function, view about NVDS_TAG_BD_ADDRESS parts.Co_null_bdaddr 0 for the whole address.
If it is all zeros dev_bdaddr nvds_get_func function called (ROM) curing function to get the address in the SDK nvds_data_storage inside structure.(in NVDS. C) in the file
If it is not zero dev_bdaddr is actually get the address.

So, can modify inside the function custom_nvds_get_func

Ye Kinson
Offline
Last seen:4 years 10 have a line
Joined:The 2016-09-07 08:14
Hi Gongyu_Dialog,

Hi Gongyu_Dialog,
I operated in the debug spi flash, the program will run fly, this is how to return a responsibility?thank you

Gongyu_Dialog
Offline
Last seen:1 day 15 hours a line
Joined:The 2016-04-27 07:07
Set pin configuration is correct?In addition, the flash function is called to initialize

Set pin configuration is correct?In addition, the flash function is called to initialize.

Ye Kinson
Offline
Last seen:4 years 10 have a line
Joined:The 2016-09-07 08:14
Hi Gongyu_Dialog,

Hi Gongyu_Dialog,
Pin has been properly configured, the initialization is initialized.Now the problem is, if you read and write flash, the program will die, don't read and write procedures as normal.

Gongyu_Dialog
Offline
Last seen:1 day 15 hours a line
Joined:The 2016-04-27 07:07
Make sure that the flash configuration

Make sure that the flash configuration, such as flash size and page size is configured correctly.
In addition, in the debug mode, can through the way of breakpoints, and see where is wrong.

If DEVELOPMENT_DEBUG open, meets the application die, usually run into HardFault_HandlerC function.
Where can see the PC/LR is kept out of the question.

Ye Kinson
Offline
Last seen:4 years 10 have a line
Joined:The 2016-09-07 08:14
Die if DEVELOPMENT_DEBUG open, encounter program

If DEVELOPMENT_DEBUG open, meets the application die, usually run into HardFault_HandlerC function.
Where can see the PC/LR is kept out of the question.
Opened DEVELOPMENT_DEBUG / / yes, it is."PC/LR "this is what mean?

Gongyu_Dialog
Offline
Last seen:1 day 15 hours a line
Joined:The 2016-04-27 07:07
Void HardFault_HandlerC

Void HardFault_HandlerC (unsigned long * hardfault_args)
{
If (DEVELOPMENT_DEBUG)
{
* (volatile unsigned long *) (STATUS_BASE + 0 x14) = hardfault_args [5]./ / LR
* (volatile unsigned long *) (STATUS_BASE + 0 x18) = hardfault_args [6]./ / PC

...

Ye Kinson
Offline
Last seen:4 years 10 have a line
Joined:The 2016-09-07 08:14
Open the # define CFG_DEVELOPMENT

After open the # define CFG_DEVELOPMENT_DEBUG;Flash operation, the program to run to void NMI_HandlerC (unsigned long * hardfault_args) "" inside the if ((GetWord16 (SYS_STAT_REG) & DBG_IS_UP) = = DBG_IS_UP) __asm (" BKPT # 0 \ n");"
thank you