Author Topic: How to debug uTasker from flash with IAR?  (Read 18350 times)

Offline Thomas

  • Newbie
  • *
  • Posts: 17
    • View Profile
How to debug uTasker from flash with IAR?
« on: September 26, 2007, 10:07:38 AM »
What are the necessary steps involved for downloading code to flash and debug from within IAR?

I downloaded an example from the Atmel site (BasicIAR-SAM7X256-IAR430A) that works fine, loads to flash and debugs fine.

http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3906
http://www.atmel.com/dyn/resources/prod_documents/BasicIAR-SAM7X256-IAR430A.zip

However I'm not sure why I cannot get IAR to download the uTasker project to flash. I started with the Release configuration and changed the linker to generate the debug file, under Debugger changed to use SAM7_FLASH.mac (from basic iar project), removed "suppress download" and checked "use flash loader(s)"

It displays the "downloading application" window but don't display the  "programming flash" window like the BasicIAR project.

Using IAR 4.42 and IAR(Segger) J-Link and uTasker 1.3SP1.

Offline Thomas

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: How to debug uTasker from flash with IAR?
« Reply #1 on: September 26, 2007, 10:36:20 AM »
Ok, I found that switching the target from Core - ARM7TDMI to Device - Atmel AT91SAM7XC256 makes a difference about flash programming. Guess the IDE has to be aware of the specific device to program it. IAR at least now displays the "Programming flash" dialog but now it just hangs completely when this dialog opens. Ideas..?

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3238
    • View Profile
    • uTasker
Re: How to debug uTasker from flash with IAR?
« Reply #2 on: September 26, 2007, 07:00:09 PM »
Hi Thomas

I tend to do the following:
1. Load the FLASH using the ATMEL SAMBA program via USB (boot program and application).
2. Debug out of FLASH
3. Load each new version using HTTP from a web browser (SAMB again in emergency when the code doesn't run...)
The use fo the boot loader is described in http://www.utasker.com/docs/uTasker/BM-Booloader_for_SAM7X.PDF

I never found out the way to program from IAR, although it certainly is possible somehow...

To debug from FLASH make sure that the following settings are correct:
- in the linker setting - Format = Debug Information for C-Spy and Module Local Symbols = "Include all"
- in debugger setting I don't set any macro file for use. Under the download option set "Suppress download".

When you connect it should load the C-Spy information containg all debug infomation and reset the device so that it starts and runs from FLASH (where the programm obviously has to be already loaded to).
I don't set run to main until it is clear that all is working - then you can check that it is stepping through the start up code.

If anyone has better information please post here!!

Good luck

regards

Mark