I would like to Interface a BLE to a MSP432 microcontroller in serial. The BLE has a inbulit Atmel controller. I have a firmware for BLE in keil. Intially I have flashed the firmware to BLE directly from a debugger and worked on the BLE. Now I should have a MSP432 in btween debugger and BLE.
I should flash the BLE via MSP432 in serial. I am planning to connect the hardware as below image. Is this way work out?. My another important question is I have to write the firmware for MSP432 and then combne the BLE code in to the MSP432 code?.
If so How can I send the perticuler BLE portion of code to the BLE?.
If I dont connect the seial pins of debugger to MSP432 how can I see the serial data on terminal in PC?.
I don't think this will work easily - if there is enough room in the MSP432 for the entire BLE firmware as well as the firmware you need to run on the MSP432 you could combine the MSP432 code image with the BLE image. Then the MSP432 would need (on receipt of some kind of instruction) to flash the BLE using the code stored in it's composite image.
If you don't have room in the MSP432 you could use some other interface on the MSP432 (like a serial port) to accept the BLE firmware from a PC (or whatever) and copy that to the BLE.
Hi Moga, if you are thinking that you will easily be able to flash the BLE device from the debug probe through the MSP432, I suspect you are going to be disappointed.
For development you would typically flash the BLE and MSP432 devices through their respective debug ports, allowing you to set breakpoints, examine memory, etc. Ideally you have two debug probes so you can easily load and debug either device, otherwise you'll have to switch back and forth.
To observe serial port activity you would typically use some piece of test equipment (eg. an analyzer, MSO, or DSO with serial decode) that connects to the RX/TX/GND signals and will trace and display serial data activity.
Flashing the BLE or MSP432 without using a debug probe is another matter. This is typically what you want to do when you are performing a firmware image update in the field. There are various ways this might be done, and how this works depends on the device hardware capabilities (limitations) and software support in the running image.
Consider the BLE device. It may be running a bootloader, in which case there should be a way to transfer control to the bootloader and load a new firmware image. The bootloader should be able to verify the new image, preferably (but not necessarily) before it clobbers the old image. The bootloader may be able to load the new image through the serial port, or wirelessly through the BLE interface.
The bootloader is not overwritten during the firmware update process, so you always have the option of reverting to the last known good image through the bootloader.
These same comments generally apply to your MSP432, you may have the same need to perform a firmware update through a serial port or similar in the field.
Device manufacturers usually provide code and example projects that give you the pieces you need to implement firmware update outside a debugger. A bootloader is typically part of this process but doesn't necessarily have to be, as long as you have some way to recover the device if there is a problem with the new firmware image or if the update fails in some way, eg. power goes out in the middle of the update. This is hard to guarantee if you don't have a bootloader or similar. One option is to have access to the BLE device debug port from the MSP432 so you can program the BLE device directly, the MSP432 is essentially your debug probe in this scenario.
I suspect that once you figure out what is required to load a new image into the BLE device through its serial port, you are going to have to add corresponding support in the MSP432 firmware. You've mentioned the possibility of embedding the new BLE image in the MSP432 image, but that means you'd have to re-flash the MSP432 any time you wanted to update the BLE device. That could probably be made to work, but typically what you'd do is have MSP432 code that allows you condition the BLE device for update and then pass the serial image through the MSP432 to the BLE device, without changing the MSP432 firmware at all. Hopefully your MSP432 has a second serial interface that can be used to communicate with an application program on a PC or similar that can drive the BLE device update, say through a USB serial interface.