ATmega128A Data Memory Issue ???

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

Hi everyone.
I am using Atmega128A_AU in my own made board, connected by Atmel-ICE tool (JTAG) to PC, where I use latest Microchip Studio.
Everything worked nice up to now, but when my Data memory usage rise above 35% (value from output after building it), it wont start when "start without debugging", it does not do anything, when I attach to it, program counter is on zero. What is really wierd to me, that when I start debugging the app on that MCU, it runs, I just dont get that...
Thanks

This topic has a solution.

Atmel-ICE
Atmel Studio 7.0

Last Edited: Sun. Feb 6, 2022 - 07:54 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you have heavy use of stack frame autos? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Welcome to AVR Freaks!

 

Do you use large arrays? - Hmm, no, that won't be it because those will show up as allocated data memory.

 

Jim 

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

Last Edited: Sun. Feb 6, 2022 - 01:34 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I write my code in C++ so I dont know, I do not manage the stack frames at all...

Atmel-ICE
Atmel Studio 7.0

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Thank you. It happened when I enlargered few arrays but I think I allready solved that problem and I feel shame which should be on me, becouse of what I discovered is going on:

I accidently set up Fuses which turn on watchdog all the time, and when arrays are too big, initializing of them takes so much time that my code did not reached "wdt_reset()" command at all. Now I switched it off in fuses and turn it on just before main loop (where its also reseted peridically) and everything is good know, even with 98% usage of data memory :D

I feel so stupid now but thanks alll for your suggestions, it took me 8 hours to discover this stupid mistake :D

Atmel-ICE
Atmel Studio 7.0

Last Edited: Sun. Feb 6, 2022 - 07:57 AM