Author Topic: SAM4E flashing first program  (Read 945 times)

0 Members and 1 Guest are viewing this topic.

Offline hsn93Topic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: bh
SAM4E flashing first program
« on: December 05, 2018, 02:45:38 pm »
hello,

i've designed board for SAM4E16E.

a very bad move i did is that i did not connect any pin in the board to led (flashing leds is really helpful for debug) or didnt put jtag connector.

anyway, i only have Erase option on the board.
and its connected to USB.


so i've connected it to the PC and i can see (COM4 as "Bossa Program Port")


now im using Bossac which supports SAM4E. to upload simple program:


after flashing the firmware, and reset, i still see the "COM4" which means the bootloader is still there? shouldnt it exit to my software until i erase the chip?  |O

what i can think of, is that SAM-BA checks for the program and cant find it in the memory, but i didnt play with the flash.ld file
flash.ld: https://pastebin.com/raw/YRZuefCa


the code has infinite loop also:
Code: [Select]
#include <asf.h>

int main (void)
{
/* Insert system clock initialization code here (sysclk_init()). */

board_init();

/* Insert application code here, after the board has been initialized. */
while(1)
{

}
}

« Last Edit: December 06, 2018, 05:43:32 am by hsn93 »
-------------------------------------
 

Offline hsn93Topic starter

  • Regular Contributor
  • *
  • Posts: 114
  • Country: bh
Re: SAM4E flashing first program
« Reply #1 on: December 06, 2018, 05:41:55 am »
the problem solved
there is boot from flash that you can set in SAM-BA i guess (somthing like fuses)..



boot to ROM bootloader from ASF code: (add flash_efc service)
Code: [Select]
flash_clear_gpnvm(1);
NVIC_SystemReset();
« Last Edit: December 06, 2018, 08:14:22 am by hsn93 »
-------------------------------------
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf