Bootloader issues with ATUC256L4U

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

I'm attempting to upload a program for the MCU and a bootloader to my ATUC256L4U in a production environment. In production they are using a windows .cmd file:

 

@echo off

setlocal enableextensions enabledelayedexpansion

: This command script programs the ISP (flash array), the ISP

: configuration word (User page) and the general-purpose fuses

echo.

echo Programming UART bootloader

atprogram -t atmelice -i awire -mb 4000000 -d atuc256l4u -v program -c --verify -f uart_bootloader_atuc256l4u.elf program --verify -f userpage_i100.hex write -fs -o 0 --values 73F7FFFF

if ERRORLEVEL 1 (

	pause

)

 

This works insofar as it seems to write all the data to the MCU but when I power the system on - nothing works. The UART connection between the ATUC256 and my Linux system gets no response.

 

However, if I use ATMEL STUDIO 7 and manually program the files into the ATUC256 through the "device programming" option - it works. Everything runs. However, when I try to verify the programming I get the error message: 

"Verifying Flash...Failed! address=0x80000000 expected=0x48 actual=0x30"

 

I did an "elfread" on both files - and indeed, it seems as if both of them are writing something to this section of the memory.

 

The elfread from the bootloader file shows:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .reset            PROGBITS        80000000 000400 000160 00  AX  0   0  4

 

and from the firmware file:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .reset            PROGBITS        80000000 000400 002010 00  AX  0   0  4

 

From the datasheet for the MCU it seems to me like this memory location is where the MCU jumps after a reset.

 

So the difference is in the Size of the two sections - i.e. they are both trying to write something to this section. I don't know what to make of this - and I am not quite sure what I should do to further investigate and fix this problem. Any ideas?

 

When I program the bootloader last I cannot get any connection to the sensor through UART - it is as if nothing ever gets initialized. I suspect that it never even jumps into main(). When I program the firmware last I am able to run the firmware just fine but the bootloader does not work.

This topic has a solution.

1010001010111101110111

Last Edited: Wed. Oct 6, 2021 - 11:49 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I ended up doing a workaround for the moment. I'm putting the bootloader in the flash, using the bootloader to program the firmware and then making a copy of the whole thing that can be programmed into the flash. It's not ideal but it's good enough for now. 

1010001010111101110111