This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
My aim is to flash a Z-stack application image to CC2530 over the serial using the Serial Bootloader . For flashing the contents I am using MSP430FR5969 as the host processor. I was able to create a .bin file of the Z-stack application and create a Linux-PC application which will read from the binary file and write the contents over the serial port of PC which is connected to the UART-A0 of the MSP430FR5969 . Also UART-A1 is connected to the CC2530 Uart.
Problem is while transmitting the binary file contents from the PC to UART-A0 of MSP430 , the transmission is halted intermediately . Can anyone provide me the real cause of this problem that why transmission from PC to MSP430 uart is halting abnormally with a random pattern?
The flow of the application is like this-It will write a data frame to the serial port PC which is transmitting the contents to MSP430 uart and MSP430 uart after receiving sends an acknowledgement back to the PC .In most cases either Linux -PC application is blocking either during the writing the frame over the serial port or reading the acknowledgement for the frame transmitted from the MSP430.
Can anyone please help me where is the problem ? On the PC serial port or UART of MSP430FR5969?
What do you mean with ‘the serial bootloader’? The built-in BSL? If so, then the sending application needs to provide the proper entry sequence. It Is not enough to just read the BIN file and send it over serial line to the MSP.
The MSP needs to be brought into BSL mode by toggling its RST and TEST lines. It is usually done by using the RTS and DTR (?) signals of the serial port, connected to these two MSP pins.
If ‘serial bootloader’ means your own serial bootloader application on MSP, well, then you should know how it works. And why it could stop. Nobody but you knows what you wrote and why it could fail.
Unless, of course, you post your code so someone can look into it.
However, if it is too complex, I guess nobody will take the time.
Thanks for your response.
Serial bootloader is for CC2530 . I didn't write my own BSL for MSP 430. I am just using MSP 430 for transferring the flash contents of the application image for CC2530 .
In current scenario I am testing the communication between MSP430 uart and PC serial port.
My problem is while transferring large number of frames over the uart of MSP 430 its generally failing after receiving one frame .
For example if application image contents consists of 3000 frames and each frame consists of 64 bytes.
It is failing most of the time after I am sending the packet to MSP430 uart and waiting for acknowledgement.
My understanding is after receiving a frame of 64 bytes , MSP 430 uart is not transmitting acknowledgement byte.
The frame at which it is stopping is random , Sometimes I am able to transfer all the frames successfully or sometimes it stops intermediately anywhere in the process.
But One thing is sure it is stopping only when MSP430 receives the frame but not able to send the acknowledgment.
Thanks and Regards
Ayush
So the MSP is getting packaged data from the PC through serial and forwarding it after checking to the CC2530, acting as sort of a CC2530 programmer?
I don’t know why you have problems with your packages. I’d have to look at your code to perhaps find the reason (provided it is not a hardware instability).
Perhaps it is a racing condition, or a missing error handling in your transfer protocol (like timeout and retransmit functionality)
You should take a look at the TFTP protocol specification (file transfer part), which basically does the same.
Hi,
Thanks for the reply.
Here's my code for transmission of data from MSP430 uart for sending data from MSP430 to PC.:
while (index < len) {
while (!(UCA0IFG & UCTXIFG));
UCA0TXBUF = buffer [index];
while (UCA0STATW & UCBUSY);
index ++;
}
The code for receiver for MSP 430 uart to receive data from PC is as follows:
while (index < len) {
while (!(UCA0IFG & UCRXIFG));
buffer [index] = UCA0RXBUF;
while (UCA0STATW & UCBUSY);
index ++;
}
Please let me know where I am doing wrong or missing something in the code.
Thanks and Regards
Ayush
In your TX while loop, you don’t need to wait for UCBUSY to clear. This is inefficient, as it waits until both, buffer and output register are empty, creating a gap between two bytes. You only need to wait for UCBUSY if you need to know when transmission is really done, while TXIFG only tells you that the buffer is empty (but transfer of the last byte may still be in progress).
Note that UCBUSY is also set when receiving.
When receiving, you must not wait for UCBUSY. As I said, it is set when receiving. So after reading RXBUF, the PC is likely already sending the next byte. Worst case, you are stuck there because the PC keeps sending, so the USCI is always busy and you wait and wait and never read the incoming bytes. Again, just wait for RXIFG; then read, then wait for RXIFG again.
Thanks Michael for your response. I will try this configuration and update it.
Thanks and Regards
Ayush
**Attention** This is a public forum