How To Test ASC Bootloader on XMC4400 Hexagon Board

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
HOW TO TEST ASC BOOTLOADER ON XMC4400 HEXAGON BOARD

Maybe someone else will find this useful.

The XMC4400 hexagon board together with DAVE environment is a great tool to play with the controller. But, when it comes to full production in customized applications, having a specific port for debugger on the board and a debugger itself may present a burden if you can prepare your board for minor changes using serial port. In my case, I use serial port as a flash-programming port and also as a system port (for setting the system parameters, checking the internal variables and so on). That is why I had to test the serial port flash-programming prior to pcb design. So, this is what I have done.

For ASC boot loader, you need to have P1.4 and P1.5 available as RXD and TXD pins. P1.4 is directly connected to COM connector pin 30. However, P1.5 is connected to U303.2 which is a bilateral switch 74LVC1G66. Its other terminal is connected to COM connector pin 27. In order to have the channel open, you need to have high level (3.3V) on U303.4 (control gate). The switch is controlled by the debugging processor U500 and whenever the board is powered from the USB, U500 processor is active and pulling the switch control signal low, trying to keep the serial line for itself. Obviously, U500 should be blocked to open the communication channel. It can be done in two steps.
1. Place the jumper pins between pads 3 and 4 at the X501 (four gold-plated holes close to the U500, reffer to board manual, last schematic) which will enable you to put U500 into reset state at will. Then, before you power up the board, place the jumper bar to short the pins. When you power-up the board, LED V502 will not light meaning the U500 is not in board debug mode (because it's in a reset state). Remove the power.
2. Connect COM connector pins 30, 27 and 1 to the uart interface circuit which will provide the interface between 3.3V signals from the microcontroller and PC UART level (up to plus and minus 12 V). I use FT232RL interface board which helps converting serial port signals onto USB signals and is being powered by PC-USB port. You can use other interface ICs like MAX3232 if you want to connect to your PC UART instead of USB.
3. Change the boot-switches BSL to ON and UART. Be sure you have written down the default position, you will need it if you want to return to default DAVE programming mode using debugger.

After you prepared your hardware, its time to set-up the software. Get the Memtool program from Infineon site (under XMC Development Tools - Software and Tool Ecosystem > Software Downloads), install it. Make sure you have all the drivers you need already installed (in my case it's FT232 USB-serial port driver from FTDI site). Before you start Memtool, connect your hexagon board with the serial interface board, power-up both of them, check the V502 LED is not operating and start the Memtool.

When the Memtool first opens, it may ask you for the target configuration. You can choose the hexagon board now or later. However, in File menu, choose Open and find the .hex file of your project you have previously compiled using DAVE or other toolchain. In left window some content will appear. Then, in menu Target, click Setup and in tab General set your serial port as access device. Then again in menu Target choose Change to select your target board (if you haven't done that already). In menu Device/Setup go to Program tab and check Automatic Sector Erase before Program and Automatic Verify after Program boxes. Click on the Connect button at the bottom of the main screen. The program will connect to the board (actually to the microcontroller). If you see Ready you can proceed to programming.

Take a look at the left text-list window. It shows some address ranges related to your hex file. At the button column to the right of the list choose Select All and then Add Sel. The entire content will be added to the right window meaning that your content is accepted for writing to the flash. Then, on the right bunch of buttons click on Program and your applicatioon will be written in the microcontroller flash. Check the response (success). Exit the program (if you like), turn the boot switches to Normal mode and reset the microcontroller. You application will run. When you want to return to standard boot

It is possible that I haven't written down all the steps in right order. Some experimenting might be needed. However, it works for me. Now that I know its ok, I can return to debug-mode playing with this mighty xmc chip. Wish you a pleasant work.

P.S. Memtool really needs good tutorial, two pages at the most, for each of the micros. It's just a matter of copy-paste with minor modifications. It will help us a lot.
0 Likes
2 Replies
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Hi,
there is already a Hand On Training for using Memtool with XMC application kit. Anyway please use the latest memtool version to have successful connection.


http://www.infineonforums.com/threads/2066-XMC_HOT-XMC4500-How-to-do-flash-programming-using-Infineo...
0 Likes
Not applicable
Travis wrote:
Hi,
there is already a Hand On Training for using Memtool with XMC application kit. Anyway please use the latest memtool version to have successful connection.


http://www.infineonforums.com/threads/2066-XMC_HOT-XMC4500-How-to-do-flash-programming-using-Infineo...


Thanks, Travis. I didn't know there was such a Hand On. Maybe it should be placed together with other XMC documents in XMC4400 folder. However, Infineon keeps pushing JTAG flashing. Sometimes, flashing without the need for auxiliary micro is a design goal. This Hand on demonstrates Memtool ASC flashing through the auxiliary micro which is "and indirect" ASC flashing.

I am confused about discrepancy between what this Hand On states and the XMC4400 data sheet. XMC4400 data sheet DO SPECIFY P1.4 and P1.5 as ASC bootloader pins. On the other hand, auxiliary micro uses pins P1.5 and P1.7 of XMC4400 which are NOT SPECIFIED as ASC bootloader pins. How is it possible? Is there some undocumented function for ASC bootloading or it's not a true ASC bootloading?
0 Likes