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.

Change of UART pins in custom BSL

Other Parts Discussed in Thread: MSP430BT5190, MSP430F5438A

Hi

We are using MSP430BT5190 / MSP430F5438A.

We want to use the UART BSL for programming the firmware in field over a serial port. For this we need to change the BSL UART pins from P1.1 and P1.2 to P9.4 and P9.5 on the pins where we have the UART interface to communicate to the PC over serial port. How this can be achieved? Thanks in advance for the supports.

Regards,

Thomas CN

  • At first you should read the SLAA450c document, it called "Creating a Custom Flash-Based Bootstrap Loader".

  • Hi Tankist,

    Thanks for the information. Yes, already gone through this document. It seems like the TX_PORT_SEL definitions in BSL_Device_File.h have to be modified for changing the UART pins. Since I am very new to this topic I wanted to get more information on whether only these changes will do the job or any other modifications are also required? Can you please advice on this? 

    Regards,

    Thomas

  • Thomas CN20 said:
    Since I am very new to this topic

    Thomas, Welcome to the forum and to MSP430.

    You asked a question about something likely others here have not done. The consequence is that you are essentially asking others to do your engineering work for you.

    The BSL source code isn't a million lines long. I am sure you can follow the program flow and root out what changes need to be made.

    You're more likely to get help if you try to get it working first and come back with "I did this.... but this didn't work... and I tried these things....."

  • The BSL uses these pins for a reason. These pins are the timerA.0 and TimerA.1 pins, as the BSL uses the timer capture and compare/PWM features to generate the timing. It is not about manually setting or reading GPIO pins.

    You can’t use different pins unless you change the BSL code to use a different timer (if available, and you’re still limited to its available capture/PWM pins) or are able to do port mapping of the timer pins to the desired port (unlikely)

    Alternatively, you can rewrite the BSL code to use the hardware UART instead of the software/timer UART. In this case you’re of course using the same pins as in your application.
    The default BSL doesn’t use the hardware UART because timing of the clock is unknown. Instead, it adjusts its timing based on the first incoming SYNC byte, so it will work with 8KBd as well as 10kBd (or what it would think would be 8 or 10kBd based on the internal timing)
    However, in your case, you know whether e.g. a crystal is attached and on which frequency, so you can use this in your own BSL version.

  • Hi ,

    Yes, by using hardware UART we are able to use the same pins in  our application for BSL communication also.  However we see error frames getting received when characters are sent continuously. The characters are proper if sent one at a time. Hope it is some timing issue and working to resolve the same. Thanks for the information

     

  • If you get individual bytes correctly but see framing errors on a byte stream, this can have different reasons.
    The baudrate might be slightly off, so that the error sums up until it crosses a critical amount at the stop bit. Or you expect two stopbits where only one is sent.

    In both cases, the start bit of the next subsequent byte will come before it should and cause a framing error. Since an idle line is the same signal level as during stop bits, individual bytes will pass.

    You may try sending with two stop bits, if you only nee done direction.

    One of the reasons why the default BSL uses a software UART is that it can adapt to the baudrate the SYNC byte comes in. As long as it is in a certain range, the exact baudrate is unimportant, the BSL will adjust to the PC baudrate. With hardware UART, this is not possible. You can only set the baudrate as precise as possible and hope the other side will do the same.

  • Hi Jens-Michael Gross,

    Thank you for the reply.

    The issue was with parity check. MSP430 BSL check even parity and our hardware at other end was not checking any parity. It is resolved.

**Attention** This is a public forum