I have a question to expert in this area. My question is the next: how i need to connect bluetooth chip to mcu to have possibility to download a program to internal flash memory and sometimes have posibility to upgrade program in internal flash.
Keywords:
Device:
Hi Sparta,
The scenario you are mentioning its a bit tricky since the primary functionallity of the 583 is to boot from the internal flash. The 583 is equipped with an OTP bootloader that takes control from the primary and checks the UART pins and SPI and the presence of an additional bootloader, called advanced bootloader. Now as far as i can understand you can either erase the internal flash from the external MCU (which need a bit of an effort since you must be sure that the 580 doesn't use it) and directly burn the image in the internal flash or you can use the 580 in order to update the flash (which is even more trickier). This kind of implementation isn't supported at the moment.
Thanks MT_dialog
Have one idea and need opinion of MT_dialog experts. The idea is next: if i use hardware SPI from MCU that will be connected to pins P0_0-P0_3 (booting pins in booting sequence) of bluetooth to download a smart program that will configure SPI (leave P2_0, P2_3, P2_4, P2_9 unconnected) of BT to internal flash and GPIOs as Software SPI. That is needed to download real firmware to internal flash using software SPI as connection between MCU and BT and internal SPI connection between flash and BT. Is it possible way to have possibility to upgrade firmware of bluetooth ??? And one more remark: can i reconfigure pins P0_0-P0_3 as GPIOs (smart program) for software SPI, (in this case i don't need software connections).
Hi Sparta,
You will have to burn an advanced bootloader to your SPI since the 583 doesn't use the pins that you mention, i dont understand your setup or what you are trying to say can you please be more descriptive ? In order to update your firmware through BLE you can use the SUOTA profile, and yes you can reconfigure the pins of the 580 during runtime.
Thanks MT_dialog
Hello MT-dialog,
Sparta and I work on the same project, so I will try to explain the problem we're having and the solution we would like to try.
We have a product based on the LPC4357, with the DA14583 chip. We are using Wi-Fi to update/upgrade the firmware on our device. We would also like to update the bluetooth firmware, if necessary over Wi-Fi. (our use-case will not allow us to update all devices by SUOTA). The software for bluetooth is in DA14583 internal flash. The DA14583 is connected to our MCU using SPI. Now as far as I understand, this is the booting sequence of the DA14583:
1. is there bootloader in OTP(yes, it was flashed by dialog), jump to OTP bootloader
2. is there bootloader in 2nd OTP, run this bootloader
3.scan all uart connections, if connection is established, download program into sysram
4. read internal flash, if program is present start running it
5. try uart again
based on this booting sequence we have the following options to update firmware ONLY when necessary (hopefully never)
1. burn smart bootloader in OTP, which will download new firmware using uart/spi and write it to flash (program will start every time, and if we make mistake in OTP we have problem)
2. boot smart program from uart, which will download new firmware using uart/spi and write it to flash (safer, mcu can always be updated, and DA will always allow for new smart program)
3.flash编写智能程序,很快就会回来的l download new firmware using uart/spi and write it to flash
we need SPI connection for HCI, and we have no uart left on device. The pins we use for SPI on MCU apparently can also be used as uart, so what we would like to do is as follows:
1. boot DA and provide smart program to DA by using uart
2. smart program configures internal flash and uart for transfer, MCU sends new firmware
3.DA reboots, now finds program in internal flash and will run new firmware
4. If firmware or smart program is broken, we can upload new smart program/firmware using uart, and smart program/firmware can be replaced on MCU by using Wi-Fi update.
Do you think that this would be a good solution to the problem? Or are there any downsides to this technique, or maybe it is not possible at all?
Kind regards,
Diederik Loos
Hi diederikloos,
我没有得到你的第三种选择,不管怎样,我同意perhaps the best way is downloading the fw from uart (the OTP solution doesn't give you enough room for testing), regarding the UART pins, after the bootloader runs from the 583 he will configure the pins and you can download the fw from the specified pins. After that, the downloaded program will erase the flash and prepare the 583 for downloading a new fw through the external MCU and wait until the program is provided (set the prefered UART pins and wait for custom specific header in order to start taking data from the UART and writing them into the SPI flash). After the download finishes the 583 should reset and the allready burned bootloader in the OTP will skip the advanced bootloader and the UART and will go for the internal flash. Yes i think that is feasible to do it. This is the only way i can see that one can write the internal flash of the 583. Also i suppose that you can also use the flash_programmer (uart_selection) in order to do this and send the corresponding commands that the smart snippets sends in order to manipulate the the flash memory of the 583 chip.
Thanks MT_dialog