I want to make a gadgets based on DA14531,intergrated with external flash , eInk display and some keys.
This is my first time to use these chips/peripheral, mybe missed some restriction,so,welcome any advices.
These are the basic ideas:
1) DA14531 as application MCU & wireless function provider;
2) eInk as displayer;
3) application code stored in external flash(maybe burn into OTP later, up to the FW size);
4) build keyBoard with ADC function;
This is not confirmed till now.
I hope I can use keyBoard controller ,GPIO interrupt and ADC together.
There is a pivotal question: Is interrupt function available when the PIN set as analog input mode?
I did not find clear info stating this in DA14531 datasheet.
Extend I/O inputs is needed for the I/O is not so much for DA14531.
5) external flash & eInk share the SPI bus together with different CS pin;
6) RESET assigned with separate pin(defalut pin P0_0);
The SPI bus will be busy during app running,so we can't let RESET share same pin with SPI bus like USB dongle.scsch
7) app will support central and client at the same time;
4 gadgets cooperate together, anyone of them works in central mode,the remainning in client mode;
8) the design based on design of USB dongle,antenna will use design of Dialog;
9) eInk part copied from design of vendor.
Why can't I upload .sch file? origal .sch file zipped with winrar:da14531.rar
Hi Xiao,Thank you for posting your question online and for your interest in our Wireless Solutions.
Xiao said:1) DA14531 as application MCU & wireless function provider; 2) eInk as displayer;
We do not provide any examples or demo with an eInk as a displayer for the DA14531. Please keep in mind that the total FW size should be less 48kB since DA14531 has 48kB of RAM.From that, 8KB are reserved for the BLE stack so you are left with close to 40KB for application code and data. From these 40KB not all can be user code, as a part is taken by the SDK, how large this part is depending on what functionalities you choose to include from the SDK. All things considered the space available for SDK + user code is approximately 40KB.I am not sure if this eInk module requires any libraries to run on the DA14531 side, but you should check the firmware size. If the firmware size ends up being an issue, you can refer on our: DA14585 - SmartBond Bluetooth 5.0 SoC with Audio Interface | Renesas which is supported by the same SDK and double the RAM (96kB) of DA14531.You can also refer on our DA14695 - Multi-Core Bluetooth® 5.2 SoC with System Power Management Unit | Renesas which is way more powerful and we provide examples for LCD modules.
Xiao said:4) build keyBoard with ADC function; This is not confirmed till now. I hope I can use keyBoard controller ,GPIO interrupt and ADC together. There is a pivotal question: Is interrupt function available when the PIN set as analog input mode?
It depends on what kind of interrupt functionality you are interested in.By default, the ADC driver provides the option for ADC interrupt based on the GPIO you have selected for the GPADC:
/** **************************************************************************************** * @brief Registers a callback function to be called within ADC_Handler. * @note Enables the ADC_IRQn interrupt. * @param[in] callback The callback function. **************************************************************************************** */ void adc_register_interrupt(adc_interrupt_cb_t callback); /** **************************************************************************************** * @brief Unregisters the callback function that was previously registered. * @note Disables the ADC_IRQn interrupt. **************************************************************************************** */ void adc_unregister_interrupt(void);
Xiao said:7) app will support central and client at the same time; 4 gadgets cooperate together, anyone of them works in central mode,the remainning in client mode;
Please refer on our Multirole example: BLE_SDK6_examples/connectivity/multirole at main · dialog-semiconductor/BLE_SDK6_examples (github.com)
Xiao said:8) the design based on design of USB dongle,antenna will use design of Dialog; 9) eInk part copied from design of vendor.
Regarding the Schematic you shared:Please refer on the AN-B-088: DA145xx Flash Selector Guide (renesas.com)On your design you have the G25D40ETIG, but on the List of Supported 3rd Part Flash devices is the G25WD40CTIG. Please make sure that the SPI Flash you have selected is the supported one.On the P1 (programming) header you should also expose P0_3 or P0_5 for the 1-wire UART programming option.In case your device hangs up during Sleep or if you have remapped the SWD GPIOs then you will not be able to access the SPI Flash via SWD interface.The P0_3 or P0_5 can be used in the DA14531 SoC (with the P0_0 HW Reset GPIO) for 1-Wire UART Programming.Please also refer on the following:AN-B-075: DA14530/531 Hardware Guidelines (renesas.com)DA14531 Hardware Design Examples — DA14531 Hardware Design Examples (renesas.com)You have selected the Buck mode power configuration:You do not have the same values for C1 and C2 on your design.Please also check on AN-B-075, section 3.2.2 XTAL, 32MHz, page: 21By selecting one of the already tested crystals you can accelerate the time of the design.P0_1, P0_6 and P0_7 can be used as GPADC GPIOs, so there is no issue.Best Regards,OV_Renesas
Thank you very much OV_Renesas
OV_Renesas said:All things considered the space available for SDK + user code is approximately 40KB.
The problem of displayer is their font library,the code size is not big.I think the RAM size limitation is a challenge,I am worried about it from the begining.According to your explaination, the bootROM will load the whole FW from OTP/external Flash once time, not load dynamically(load what needed)?If so, I need to think about how to go around.
For the cost,I'd rather sacrifice performance for bigger storage space.That is why I chose GD25D40E(512K byte).I thought I can access external flash while app running, the font library and other contents like icons will reside in external flash.
Actually the communication speed supported by GD25D40 is very fast(80M at least), can we configure the DA14531 running from external flash directly?
By the way, I need to create second ram alogrithm to burn FW to external flash, maybe there is sample code?(I remeber I have seen some information on this, but can not find them now )
OV_Renesas said:It depends on what kind of interrupt functionality you are interested in.
I have to set P0_1 as KeyBoardADC input instead of P0_6 for hibernation mode limits.
What I hope:
1) set P0_1 to analog input mode;
2) enable GPIO interrupt: GPIOx_IRQn(do not know it clearly);
3) enable ADC function on P0_1;
4) enable keyboard controller;
end user press key -> P0_1 level down -> GPIOx_IRQn triggered -> start ADC -> ADC end -> ADC_IRQn triggered -> get the volatge on P0_1 and execute following process.
system idle -> enter deep sleep/hibernation -> end user press key -> wakeup from P0_1 interrupt.
Maybe it is rare to combine AI & GPIO interrupt, I have to poll ADC value periodly if combination is not supported.
For wakeup, I can do like your said if what I thought is not right.
OV_Renesas said:Please make sure that the SPI Flash you have selected is the supported one.
As I mentioned before, I have to create the second ram alogrithm, so that does not matter.(I will develop with external debugger)
OV_Renesas said:On the P1 (programming) header you should also expose P0_3 or P0_5 for the 1-wire UART programming option.
I will use only default SWD configure to programme DA14531.
Keep P0_0 as reset only.
OV_Renesas said:You do not have the same values for C1 and C2 on your design.
I copied from USB dongle design, C1 & C2 is not same indeed, if it is better to set them same, I will change it.
OV_Renesas said:By selecting one of the already tested crystals you can accelerate the time of the design.
Yes, I will try to find a verified brand.
Additional question:
I will use 3.7v lithium battery, it will up to 4.2V at the most, can I connect it to V_HIGH directly? The upper is 3.6V according to datasheet, but I don't believe that
Thanks for help.
Hi Xiao, Thank you for the reply.
Xiao said: The problem of displayer is their font library,the code size is not big.I think the RAM size limitation is a challenge,I am worried about it from the begining.According to your explaination, the bootROM will load the whole FW from OTP/external Flash once time, not load dynamically(load what needed)?If so, I need to think about how to go around.
Xiao said:
Xiao said: Actually the communication speed supported by GD25D40 is very fast(80M at least), can we configure the DA14531 running from external flash directly?
Regarding the SPI clock speed: Please refer on the DA14531 Datasheet, on section 16. SPI Interface:
Even if the GD25D40 can support up to 80MHz clock speed, the DA14531 will not be possible to support that. The DA14531 cannot be configured to run the firmware directly from the external flash. Please refer on the DA14531 Datasheet, on section 5.5 BootROM Sequence, page: 67
As you can see, if you use the OTP or an external flash/eeprom the code will be downloaded into the SRAM.
Xiao said: By the way, I need to create second ram alogrithm to burn FW to external flash, maybe there is sample code?(I remeber I have seen some information on this, but can not find them now )
Could you please clarify what exactly you are trying to do? Are you referring on the production stage how you could program multiple devices? I do not understand the following statement: "I need to create second ram algorithm to burn FW to external flash". Please provide more information.
Xiao said: What I hope: 1) set P0_1 to analog input mode; 2) enable GPIO interrupt: GPIOx_IRQn(do not know it clearly); 3) enable ADC function on P0_1; 4) enable keyboard controller; end user press key -> P0_1 level down -> GPIOx_IRQn triggered -> start ADC -> ADC end -> ADC_IRQn triggered -> get the volatge on P0_1 and execute following process. system idle -> enter deep sleep/hibernation -> end user press key -> wakeup from P0_1 interrupt.
1) Set P0_1 as analog input (on user_periph_setup.h/c files) 2) Use Wake-Up Controller for the GPIO interrupt (P0_1) or generic GPIO Interrupt. Note: If you use Extended Sleep mode work with Wake-Up controller, else you can use the GPIO interrupts API 3) On the Wake-Up controller callback or the GPIO interrupt callback Initialize and Start ADC. 4) Make sure that Wake-Up controller is set in order to wake-up from Deep or Hibernation sleep mode. Note: Please refer on the prox_reporter example This logic can be implemented and it will work as expected.
Xiao said: I will use only default SWD configure to programme DA14531.
Since you are interested in Deep Sleep and Hibernation sleep modes, you should expose P0_5 or P0_3 as well. If your code crashes inside Deep Sleep or Hibernation, the SWD interface will be disabled. You will not have any other way to retrieve the DA14531 from this state other than UART programming.
Xiao said: I will use 3.7v lithium battery, it will up to 4.2V at the most, can I connect it to V_HIGH directly? The upper is 3.6V according to datasheet, but I don't believe that
Unfortunately, you will have to believe that. The DA14531 would not be able to handle 4.2V on power supply. The DA14531 was designed to work ideally with coin cells. Since you want to use a lithium battery, you will need to find a voltage regulator for the VBAT. Best Regards, OV_Renesas
Thank you for your reply.
IK_Renesas said:I do not understand the following statement: "I need to create second ram algorithm to burn FW to external flash". Please provide more information.
Maybe I can't use offical tools since I use custom hardware(but I can use tools related to USART,I think )
Have found the content: \DA145xx_SDK\6.0.16.1144\utilities\secondary_bootloader.
I think I have to create a secondary alogrithm to burn FW to external flash for the flash chip changed.
IK_Renesas said: If your code crashes inside Deep Sleep or Hibernation, the SWD interface will be disabled.
OK, I will expose it too,that can be used to output debug info anyway.
But I do not get the reason. The PINs are default,SWD should work if cold start / hardware reset triggered.
IK_Renesas said:Since you want to use a lithium battery, you will need to find a voltage regulator for the VBAT
OK, but I am sure DA14531 will work fine without regulator.
The inductor value placed between VBAT_LOW and LX should be exactly 2.2uH or any bigger one is fine?I'm nervous with inductor, they leave me at a loss in other power source PCB.
Thanks.
OV_Renesas said:Please refer on our Multirole example: BLE_SDK6_examples/connectivity/multirole at main · dialog-semiconductor/BLE_SDK6_examples (github.com)
I'm just trying to compile it to make sure configure is right.
After complete the SDK6patch.diff, I get these errors/warnnings:
And these changes cause error(examples can be complied without error before trigger error now: #error "Cannot use ROM app task symbols if number of connections is greater than 1. looks like the patch fix failed)[ solved with preprocessor symbol: __EXCLUDE_ROM_APP_TASK__ ]
Select device:DA14531
select AC5
compile,I get these errors & warnings:
Many of them.
But the files exist:
I have compared with other examples(can compile successfuly),the sets on this site is different:
This example:
-mthumb -c -include da1458x_config_basic.h -include da1458x_config_advanced.h -include user_config.h
others:
--thumb -c --preinclude da1458x_config_basic.h --preinclude da1458x_config_advanced.h --preinclude user_config.h --bss_threshold=0 --feedback=".\unused_531.txt"
Change -mthumb to --thumb:
The error should be triggered by pre warnnings.
I don't know if I made mistake in those steps or there are other action I should take.
Hi Xiao,Thank you for the reply.
Xiao said:But I do not get the reason. The PINs are default,SWD should work if cold start / hardware reset triggered.
Please refer here: 5. Booting (renesas.com)When you do a hardware reset, you will have a few ms before the SWD interface is disabled again from the firmware. We have to recommend to have P0_3 or P0_5 exposed for UART programming. It is up to you, if you want to actually expose them.
Xiao said:The inductor value placed between VBAT_LOW and LX should be exactly 2.2uH or any bigger one is fine?
Please refer on our: AN-B-075: DA14530/531 Hardware Guidelines (renesas.com)According to the document, the inductor should be 2.2uH.
Xiao said:I'm just trying to compile it to make sure configure is right. After complete the SDK6patch.diff, I get these errors/warnnings:
From my understanding you are trying to use SDK v6.0.16.All our Git examples have been ported into SDK v6.0.18. This is why the patch can not be applied on the SDK v6.0.16.I have uploaded the modified SDKs (v6.0.14, v6.0.16, v6.0.18 and v6.0.20) for the Multirole example.Please work with these:
Please download files from the following URL: <https://upload.hdedrive.com/ui/renesas.com/dl/SB1707990972-1b06db38-1b58-4d05-9cf4-8df229107312>
* This URL requires guest identity verification as well as download password authentication. Once the identity verification passed, the verification step can be skipped for up to 30 days in the same browser.
Download Password: K&^!2^ji9LPB
This URL will expire on February 29, 2024 11:56 AM (UTC+02:00)Best Regards,OV_Renesas
Thank you very much for your help.
OV_Renesas said:When you do a hardware reset, you will have a few ms before the SWD interface is disabled again from the firmware.
Yes,I got the reason, hardware has been controlled by bootROM after reset, there is a short time for SWD to take over, after that enter boot loop. The chip maybe be blocked by wrong code.
OV_Renesas said:I have uploaded the modified SDKs (v6.0.14, v6.0.16, v6.0.18 and v6.0.20) for the Multirole example.
You are so kind.
It can be compiled by AC6 now(SDK6.0.20),that is great.
Thank you.