Programing custom board using 1-Wire with DevKit Pro

Hello Team,

SDK:  6.0.16.1144

Module: DA14531MOD

Development Kit: DevKit Pro.

I am having DA14531MOD custom board with P0_5 exposed to program it as I am using SWDIO and SWCLK as GPIO by disabling its SWD using:

SetBits16(SYS_CTRL_REG, DEBUGGER_ENABLE, 0);

I followed the description as mentioned in AN-B-072 to use 1-Wire UART programming, but I could program DA14531MOD daughter board connected to DevKit Pro. However, I want to burn the flash on my custom board. I have tried to power it from the DevKit Pro and connected custom board P0_5 to DevKit Pro P25 on J2 but could not make it. When I choose Board -> Device Info/Detect Device it askes to press RESET and it never detecting that I pressed the reset. It working fine with DA14531OD Daughter board though.

I do not have direct UART module like FTDI at the moment in my hand to try out as I am out of office but I have DevKit Pro. So, I would like to use DevKit Pro itself. Where I need to connect the P0_5 of my custom board to DevKit Pro.

I looked into multiple forum questions but all talks about AN-B-072 and using FTDI but not DevKit Pro to Custom board.

Thanks & Regards

Harish.

  • Hi Harish,

    Thank you for posting  your question online.
    Can you make sure that you have not downloaded any FW previously on your custom board that disables the HW Reset pin?
    The HW Reset pin is disabled by the following function:

    /**
     ****************************************************************************************
     * @brief Disable hardware reset functionality on P00.
     ****************************************************************************************
     */
    __STATIC_FORCEINLINE void GPIO_Disable_HW_Reset(void)
    {
        SetWord16(HWR_CTRL_REG, 1);
    }

    You can also probe a logic analyzer on the P0_0 (HW reset Pin) and on P0_5 (1-Wire UART) to see the activity when trying to program your board.

    You could also use the SWD interface, program your custom board but after that you will not be able to access it again via SWD. 

    I followed the description as mentioned in AN-B-072 to use 1-Wire UART programming, but I could program DA14531MOD daughter board connected to DevKit Pro. However, I want to burn the flash on my custom board. I have tried to power it from the DevKit Pro and connected custom board P0_5 to DevKit Pro P25 on J2 but could not make it. When I choose Board -> Device Info/Detect Device it askes to press RESET and it never detecting that I pressed the reset. It working fine with DA14531OD Daughter board though.

    For the DA14531MOD Daughter board we are following this configuration of the Dev Kit Pro in order to program it via 1-Wire UART.

    By placing the jumpers on J1, we Connect a 1kΩ resistor between Rx-Tx and we use P0_5.
    So, please refer on UM-B-141:

    Try to add a 1kΩ resistor between P0_6 and P0_5.

    Kind Regards,
    OV_Renesas

  • Hi OV_Renesas,

    Thank you for looking into it and replying.

    Can you make sure that you have not downloaded any FW previously on your custom board that disables the HW Reset pin?

    I have not disabled REST pin. The reset functionality is working fine when I burn using SWD(SWDIO/SWCLK) and also the current burnt code is working fine and RESET also working fine.

    You could also use the SWD interface, program your custom board but after that you will not be able to access it again via SWD

    Yes, I would like to use 1-WIre permanently on my custom board so even if it does not work with SWD it is fine.

    I followed the same jumper settings as mentioned in 5.9.1. As mentioned I could do program on Daughterboard so these jumper settings are correct. The problem is programming custom board. I have already connected the MB2_5 to P0_5 on my custom board as mentioned in the Table-5 in UM-B-141 and Table-4. But still it was not detecting the RESET event when I press the RESET button on custom board. 

    So, my connections are correct as you suggested. And also I have SWD pins as well and I could program through them without any problem on my custom board(I still did not disabled SWD pins on my custom board hence its working fine). 

    I will connect Logic Analyzer on P0_5 and REST on my custom board and will see what is happening on those pins.

    Thanks,

    Harish.

  • Hi Harish,

    Thank you for the reply and the feedback.
    How are you handling the P0_0 pin on your custom board? Is it connected to the GND and with a switch you trigger it to high? 
    Have you added the 1kΩ resistor between P0_5 and P0_6 which is necessary for 1-Wire UART programming?

    Kind Regards,
    OV_Renesas

  • Hi OV_Renesas,

    On my custom board P0_0(RST) was connected to VSS via 4.7K resistor(Please ignore two switches on RST pin as for some testing I have two switches with different shapes. Both will work independently).

    Is it connected to the GND and with a switch you trigger it to high? 

    RST pin was not connected to ground just to VSS via resistor. I saw in DaughterBoard schematic in DevKit Pro and it was same like this:

    This is how I have connected on my DevKitPro and jumper settings:

    I have tried with FTDI module like this as mentioned in the thread: da14531-flashing-methods

    I could not see any pulses on P0_5 pin with both DevKit Pro and FTDI module, I could see only RST pulse that I have pressed.

    Have you added the 1kΩ resistor between P0_5 and P0_6 which is necessary for 1-Wire UART programming?

    While trying with DevKit Pro I have not added any extra resistor, as I hope this will be taken care by the jumpers. However I have added resistor on FTDI module as mentioned in the above picture. I have connected only 3 wires to the custom board as mentioned in the above image - VSS, GND, P0_5. Do I need to connect P0_6 as well, I am using 1-Wire so I am hoping P0_5 alone is sufficient, please correct me if my understanding is wrong. 

    Thanks,

    Harish.

  • HI Harish,

    Thank you for the reply.

    RST pin was not connected to ground just to VSS via resistor. I saw in DaughterBoard schematic in DevKit Pro and it was same like this:

    As you can see from the screenshot you shared, after the 4.7kΩ resistor we go to ground (TP15). The RST pin should be connected to GND and when the switch is pressed, triggered to high.

    On J1 header of the Development Kit Pro, I would remove all the dip switches other than RxTx.

    While trying with DevKit Pro I have not added any extra resistor, as I hope this will be taken care by the jumpers. However I have added resistor on FTDI module as mentioned in the above picture. I have connected only 3 wires to the custom board as mentioned in the above image - VSS, GND, P0_5. Do I need to connect P0_6 as well, I am using 1-Wire so I am hoping P0_5 alone is sufficient, please correct me if my understanding is wrong. 

    Since you have a FTDI module, I would recommend to work with that because we have not an official guide/tutorial on how to perform 1-Wire Tutorial on a custom board via the Development Kit Pro.
    On your FTDI module, you should connect as shown on the screenshot you shared. 
    Rx and Tx with a 1kΩ resistor and one of those pins with P0_5. You should connect Vcc to VSS and GND to ground. Have you connected to GND all the GND pins? 
    When you have probed a logic analyzer on P0_0 and P0_5 you should see something like this when you are prompted to press the RST pin for 1-Wire UART programming:


    Kind Regards,
    OV_Renesas

  • Hi OV_Renesas,

    As you can see from the screenshot you shared, after the 4.7kΩ resistor we go to ground (TP15). The RST pin should be connected to GND and when the switch is pressed, triggered to high.

    I am confused. Does this mean TP15 is Ground? How it will be possible as when S3(RST) is pressed its connected to VBAT_MOD which is Power supply rail and it will be directly connected to ground right?

    What is RST pin here, isn't it P0_0? If we connect it to GND directly and connected it to S3 switch via 4.7k and then VBAT_MOD, how it will function to trigger as +ve to RST pin which is directly tied to GND. I think, I am missing something here or am I am missing some schematic here? The description and schematic looks confusing.

    Any way, I have connected a 10K resistor on RST pin to ground.

    Have you connected to GND all the GND pins?

    Yes, on my custom board all GND pins of DA14531MOD((J1, J2, J3, J4, J6, J11) ) are inter-connected.

    Since you have a FTDI module, I would recommend to work with that because we have not an official guide/tutorial

    Sure, I will use FTDI module.

    After connecting the 10K resistor from RST pin to GND, now I can see pulses on P0_5 and RST pin as well like:

    Good that one step further. However, on SmartSnippets Toolbox still it says Reset Signal did not detected, tried with couple of times and even long press for RST button. 

    Anything else I should check?

    Thanks,

    Harish.

  • Hi OV_Renesas,

    One more point I observed is in your the P0_5 is starting with HIGH and as soon as the RST is triggered its pulling LOW and again pulling HIGH.

    However, I in my capture, the P0_5 is kept low and as after RST is triggered it came HIGH and a LOW spike and again HIGH.

    In my application that is already existed in the flash, I am using P0_5 as EN pin of a sensor. In user_periph_setup I configured P0_5 as LOW by default. Does it give any problem? Can I use P0_5 in my application when I use 1-Wire UART programming mode?

    The reason for moving to 1-Wire programming is I need more I/Os hence I have disabled SWD(SWDIO and SWCLK) and using as GPIO and would like to use P0_5 as well in my application. Please let me know if I should not be using P0_5 in my application or I can use it and  no problem in programming it using 1-Wire UART.

    Thanks,

    Harish

  • Hi OV_Renesas,

    Again I have tried different ways to check further.

    I have removed all the external connections from SWDIO, SWCLK, and P0_5 and created two programming ports one with SWD/JTAG and another one with 1-Wire with P0_5.

    I have used Blinky example code for burning the code with both JTAG and 1-Wire methods.

    1. With SWD/JTAG, I connected my custom board to DevKit Pro using SWDIO, SWCLK and I could burn the code and the LED on the custom board is blinking as per the code.

    2. The same Blinky.HEX, now I have used FTDI module with 1-Wire to P0_5. I could connect using "Connect" in SmartSnippets Toolbox and could burn the code as well. First, it said it could burn the code but reset failed - "Failed to send a reset command to the board. Replug the board to start the application.". When I tried a second time, it could burn, and reset also succeeded. However, the code is not functional, and LED on my custom board was not blinking at all. Just for information in both ways, I have used the same Blinky HEX file. I have attached both the SmartSnippets console log and Blinky HEX file.

    From the above test, I could confirm that my custom board is working fine from a functional perspective as it worked when I burned the code using SWD/JTAG but not worked only with 1-Wire programming method.

    Sorry for the multiple replies, I keep on trying different ways as I am lost here and completely blocked and could not proceed further. 1-Wire is the only hope as I need to use SWDIO and SWCLK as GPIO on my custom board due to limited I/O ports available on this module.

      

    Thanks,

    Harish.

    blinky_531.zip

    connect-and-burn-3.log
    [INFO     SPI Flash Programmer@23-05-23 22:20:52] Copying file: C:\workspace\Electronics\tools\renesas\SDK_6.0.16.1144\DA145xx_SDK\6.0.16.1144\projects\target_apps\peripheral_examples\blinky\Keil_5\out_DA14531\Objects\blinky_531.hex to C:\Users\Harish\AppData\Local\Temp\\input1.hex.
    [INFO     SPI Flash Programmer@23-05-23 22:20:53] Converting file input1.hex to bin.
    [INFO     Flash Code@23-05-23 22:20:53] Read 3728 bytes from file C:\Users\Harish\AppData\Local\Temp\\input1.bin.
    [INFO     Flash Code@23-05-23 22:20:55] Firmware File C:\Program Files\SmartSnippetsToolbox\SmartSnippetsToolbox5.0.22\common_resources\SupportPackages\DA1453x\toolbox_resources/common/flash_programmer_531.bin has been selected for downloading.
    [INFO     Flash Code@23-05-23 22:20:55] Connection to COM8 port has successfully opened.
    [INFO     Flash Code@23-05-23 22:20:55] Started download procedure...
    [INFO     Booter@23-05-23 22:20:57] Successfully disconnected from port COM8.
    [INFO     SPI Flash Programmer@23-05-23 22:20:57] Connection to COM8 port has successfully opened.
    [INFO     Booter@23-05-23 22:20:57] Successfully disconnected from port COM8.
    [INFO     SPI Flash Programmer@23-05-23 22:20:57] Successfully configured SPI ports and pins.
    [INFO     Flash Code@23-05-23 22:20:57] Successfully downloaded firmware file to the board.
    [INFO     Flash Code@23-05-23 22:21:01] Started burning memory with 3728 bytes of data at address 0x00.
    [INFO     SPI Flash Programmer@23-05-23 22:21:01] Connection to COM8 port has successfully opened.
    [INFO     Booter@23-05-23 22:21:01] Successfully disconnected from port COM8.
    [INFO     Flash Code@23-05-23 22:21:01] Write 3728 bytes at offset 0x00
    [INFO     Flash Code@23-05-23 22:21:01] Memory burning completed successfully.
    [INFO     Flash Code@23-05-23 22:21:01] Reading memory to refresh table contents....
    [INFO     Flash Code@23-05-23 22:21:01] Connection to COM8 port has successfully opened.
    [INFO     Booter@23-05-23 22:21:02] Successfully disconnected from port COM8.
    [INFO     Flash Code@23-05-23 22:21:02] Read 3728 bytes from offset 0x00
    [INFO     Flash Code@23-05-23 22:21:02] Reading has finished. Read 3728 bytes.
    [ERROR    General@23-05-23 22:21:02] COM8 is in use. Please replug the board and try again.
    [ERROR    General@23-05-23 22:21:02] Failed connecting to port COM8.
    [WARNING  Flash Code@23-05-23 22:21:02] Failed to send reset command to the board. Replug the board to start application.
    [INFO     Flash Code@23-05-23 22:22:10] Firmware File C:\Program Files\SmartSnippetsToolbox\SmartSnippetsToolbox5.0.22\common_resources\SupportPackages\DA1453x\toolbox_resources/common/flash_programmer_531.bin has been selected for downloading.
    [INFO     Flash Code@23-05-23 22:22:10] Connection to COM8 port has successfully opened.
    [INFO     Flash Code@23-05-23 22:22:10] Started download procedure...
    [ACTION   Flash Code@23-05-23 22:22:11] Please press the hardware reset button on the board to start the download process.
    [INFO     Flash Code@23-05-23 22:22:11] Reset detected
    [INFO     Booter@23-05-23 22:22:13] Successfully disconnected from port COM8.
    [INFO     SPI Flash Programmer@23-05-23 22:22:13] Connection to COM8 port has successfully opened.
    [INFO     Booter@23-05-23 22:22:13] Successfully disconnected from port COM8.
    [INFO     SPI Flash Programmer@23-05-23 22:22:13] Successfully configured SPI ports and pins.
    [INFO     Flash Code@23-05-23 22:22:13] Successfully downloaded firmware file to the board.
    [INFO     Flash Code@23-05-23 22:22:15] Started burning memory with 3728 bytes of data at address 0x00.
    [INFO     SPI Flash Programmer@23-05-23 22:22:15] Connection to COM8 port has successfully opened.
    [INFO     Booter@23-05-23 22:22:16] Successfully disconnected from port COM8.
    [INFO     Flash Code@23-05-23 22:22:16] Write 3728 bytes at offset 0x00
    [INFO     Flash Code@23-05-23 22:22:16] Memory burning completed successfully.
    [INFO     Flash Code@23-05-23 22:22:16] Reading memory to refresh table contents....
    [INFO     Flash Code@23-05-23 22:22:16] Connection to COM8 port has successfully opened.
    [INFO     Booter@23-05-23 22:22:16] Successfully disconnected from port COM8.
    [INFO     Flash Code@23-05-23 22:22:16] Read 3728 bytes from offset 0x00
    [INFO     Flash Code@23-05-23 22:22:16] Reading has finished. Read 3728 bytes.
    [INFO     General@23-05-23 22:22:16] Connection to COM8 port has successfully opened.
    [INFO     Booter@23-05-23 22:22:16] Successfully disconnected from port COM8.
    [INFO     Flash Code@23-05-23 22:22:16] Successfully sent reset command. If application won't start replug the board.
    

  • Hi Harish,

    Thank you for the replies.
    Glad you were able to perform 1-Wire UART programming. 
    Let me share a more detailed logic analyzer trace of the procedure.
    When I have SmartSnippets Toolbox set for 1-Wire UART Programming and Press the Connect Button:


    And if we zoom in, we can see the P0_5 we can see the Start of Heading (SOH) byte (0x01) with some Header bytes as well being transferred:


    After that, we trigger the RST pin 

    And we can see on P0_5 the Start of Text (STX) bytes 0x02:

    After that there is a lot of activity on the P0_5 and on the end we receive the ACK byte of 0x06:

    Are you able to see the STX and ACK bytes on P0_5?
    You said you were able to use 1-Wire UART programming, the RST pin was connected to GND?

    Replug the board to start the application.". When I tried a second time, it could burn, and reset also succeeded. However, the code is not functional, and LED on my custom board was not blinking at all. Just for information in both ways, I have used the same Blinky HEX file. I have attached both the SmartSnippets console log and Blinky HEX file.

    Could you please try to connect (after having preformed 1-WIre UART programming) and Read the contents of the SPI Flash? Could you compare it with the original .hex file if it is corrupted?
    After you have performed 1-Wire UART programming, the RST pin should not be connected to GND since it works as the MOSI pin for the SPI Flash as well:
    From the DA14531MOD Datasheet:

    In my application that is already existed in the flash, I am using P0_5 as EN pin of a sensor. In user_periph_setup I configured P0_5 as LOW by default. Does it give any problem? Can I use P0_5 in my application when I use 1-Wire UART programming mode?

    Yes, you can use the P0_5 is your application for any reason and perform 1-Wire UART programming as well. When you press the RST pin the ROM bootloader is executed, and the Pins are on their default state which can be found on the DA14531MOD datasheet, on chapter 3. Pinout, page: 7


    Kind Regards,
    OV_Renesas

  • Hi OV_Renesas,

    Thank you for the detailed logic analyzer trace. I will cross-check with my logic analyzer trace.

    Could you please try to connect (after having preformed 1-WIre UART programming) and Read the contents of the SPI Flash? Could you compare it with the original .hex file if it is corrupted?

    Sure, I will compare both of them.

    Yes, you can use the P0_5 is your application for any reason and perform 1-Wire UART programming as well. When you press the RST pin the ROM bootloader is executed, and the Pins are on their default state which can be found on the DA14531MOD datasheet, on chapter 3. Pinout, page: 7

    This good to know that I can use the pins for my own purpose even though they have special functionality, Is this true with SWDIO and SWCLK as well? As, this raises the basic question and root for this entire thread. Initially I was using SWDI and SWCLK and was very happy with programming and testing on my custom board, However, when I started using SWDIO and SWCLK in my application, I was facing issues of not able to program when my external device is connected and could not use them as INT Wake-up controller as well(I am having conversation over another thread: da14531---sensor-values-reading-for-a-long-time-without-ble-advertise---does-not-trigger-the-callback-by-wkupct_register_callback). And also I saw in other thread that I need to disable SWD functionality in my code and hence I started using 1-Wire method, any way I will continue that thread separately. Or if you are the one who is handling that thread as well, you can suggest me the best method.

    After you have performed 1-Wire UART programming, the RST pin should not be connected to GND since it works as the MOSI pin for the SPI Flash as well:

    I have connected RST(P0_0) pin to GND via 10K resistor and to +ve via 4.7K resistor as shown below:

    Is this fine having pull-down resistor to GND? If not how we can have a GND rail only during the programming but not after that. Should we have a mechanism to have this grounded when the programming plug is inserted and disconnect from GND when it is removed? Do you have any recommended reference schematic how to use 1-Wire programming port on custom boards? AS custom boards are pretty common than using DaughterBoard, so, I guess you might have some reference design, please suggest from the best practices.

    And just for the information, the same circuit, like having RST connected to GND via 10K was working when I burned the code via JTAG. In this case it is able to load from the Flash via SPI hence I assume this 10K pull down will not give any problem. Please correct me if my understanding is not correct.

     

    Thanks,

    Harish.