View previous topic :: View next topic |
Author |
Message |
jacko
Joined: 20 Dec 2010 Posts: 19
|
Posted: Tue Jan 11, 2011 3:29 pm Post subject: cemu: not enough RAM |
|
|
Hello,
I am using a TP2.
I have developped my application using a TL2. It works fine.
I have cut a simcard, and inserted it with a Turbo SIM in my phone. It works.
Now, when I try to program the Turbo SIM on the TP2, I get the following error :
ERROR: Not enough RAM
The SIM card is inserted when I try to program, I get the ATR. I can program the exact same .trb file onto the TL2 but not on the Turbo SIM.
What's happening?
Thanks |
|
Back to top |
|
 |
pz
Joined: 12 Mar 2004 Posts: 1161
|
Posted: Wed Jan 12, 2011 9:08 am Post subject: |
|
|
The RAM size can depend on device or kernel version.
What does avr-objdump says when you make the app?
E.g. Size PROGMEM: 200 RAM: 0
Can you try to "cemu --reset" the TSIM just to be sure it's not residue of another app? |
|
Back to top |
|
 |
jacko
Joined: 20 Dec 2010 Posts: 19
|
Posted: Wed Jan 12, 2011 3:32 pm Post subject: |
|
|
Hello,
avr-objdump says PROGMEM: 4962 RAM: 174
Here's what I have tried :
cemu --reset
==> OK
cemu --rm-apps
==> OK
cemu --app .../myapp.trb
==> ERR Not enough RAM
I also tried without rm-apps :
cemu --reset
==> OK
cemu --app .../myapp.trb
==> ERR Not enough RAM
btldr -s -i says
Unsupported or locked
I tried to "unlock" the card with cemu using the "TPIN" printed on the label that came with the card, but it says "wrong pin" (unlock answer 9804).
I assumed the TPIN printed is in fact the PUK of the TPIN, so I used --pin 0000 -puk [printed on label], but it said "unblock failed: wrong puk" (unblock answer 9804)
I did only one try of the above commands so as not to block the card.
I am lost here: what is the TPIN printed on the label with the card? How do I use it? Is my card really locked?
What should I do next? Thanks |
|
Back to top |
|
 |
pz
Joined: 12 Mar 2004 Posts: 1161
|
Posted: Mon Jan 17, 2011 10:12 am Post subject: |
|
|
RAM 174 bytes for clean device shouldn't be problem.
TPIN does the same as --reset, it can be used from phone itself, i.e. when turning on the phone enter this TPIN, phone says error, then enter proper SIM PIN.
But cemu --reset should do. If not then the last/best option would be to reflash the TSIM kernel with btldr. What exactly means "unsupported or locked"? Can you post some dump or screenshot?
Btw. what does "cemu --info" say? |
|
Back to top |
|
 |
jacko
Joined: 20 Dec 2010 Posts: 19
|
Posted: Tue Jan 18, 2011 1:09 pm Post subject: |
|
|
pz wrote: | But cemu --reset should do. If not then the last/best option would be to reflash the TSIM kernel with btldr. What exactly means "unsupported or locked"? Can you post some dump or screenshot? |
btldr just says this: "Unsupported or locked."
Is there a way to reflash the bootloader ? I have an AVRisp if needed.
Also where can I find the kernel to reflash ?
pz wrote: | Btw. what does "cemu --info" say? |
It gives the ATR and then:
Code: | Kernel version: 1.5.7.0
Serial num: xxxx-xxxxxxxxx
Unknown tag 07: 0000
Unknown tag 0c: ffff
Unknown tag 0b: 01
Unknown tag 06: 10
Unknown tag 03: 02
Unknown tag 04:
Unknown tag 05: (the ATR)
Unknown tag 0e: 00
OK. No error. |
|
|
Back to top |
|
 |
pz
Joined: 12 Mar 2004 Posts: 1161
|
Posted: Tue Jan 18, 2011 6:13 pm Post subject: |
|
|
What turbo-prog-utils package/version do you use?
Seems like kernel version vs. turbo-prog-utils version issue.
Bootloader cannot be reflashed. Latest/whatever kernel we usually send by email.
Btw. what kernel version is the TL2? Please post cemu --info. |
|
Back to top |
|
 |
jacko
Joined: 20 Dec 2010 Posts: 19
|
Posted: Wed Jan 19, 2011 8:39 am Post subject: |
|
|
pz wrote: | What turbo-prog-utils package/version do you use?
Seems like kernel version vs. turbo-prog-utils version issue. |
I am using turbo-prog-utils version 3.2.3
pz wrote: | Bootloader cannot be reflashed. Latest/whatever kernel we usually send by email. |
Ok. I can try reflashing the kernel. Can you send me the latest TSIM kernel to the e-mail address associated with my forum account?
pz wrote: | Btw. what kernel version is the TL2? Please post cemu --info. |
It gives the ATR, and then :
Code: | Kernel version: 1.3.7.0
Serial number: xxxx-xxxxxxxxx
OK. No error. |
|
|
Back to top |
|
 |
jacko
Joined: 20 Dec 2010 Posts: 19
|
Posted: Wed Jan 19, 2011 3:37 pm Post subject: |
|
|
Now I don't get it at all, it also stopped working on the TL2.
It's like there is a memory leak.
Is it possible that I am not disallocating the EEPROM memory correctly in my app?
Won't a --reset also reset the EEPROM memory?
Is there something I can check on the .trb file?
I have tried reflashing the TL2 with btldr, and I still cannot program it. It's like the .trb file is corrupted somehow.
Any help will be very much appreciated. |
|
Back to top |
|
 |
jacko
Joined: 20 Dec 2010 Posts: 19
|
Posted: Thu Jan 20, 2011 9:44 am Post subject: |
|
|
By refactoring my application, I was able to reduce the memory usage to 96 bytes.
Now the problem is gone. Looks like 176 was too much RAM.
How much RAM is available for the application ? The ATm128 microcontroller has 4Kbytes RAM
Thanks ! |
|
Back to top |
|
 |
pz
Joined: 12 Mar 2004 Posts: 1161
|
Posted: Thu Jan 20, 2011 12:11 pm Post subject: |
|
|
jacko wrote: | By refactoring my application, I was able to reduce the memory usage to 96 bytes.
Now the problem is gone. Looks like 176 was too much RAM.
How much RAM is available for the application ? The ATm128 microcontroller has 4Kbytes RAM
Thanks ! |
Aaah, yes, you are using it as global variables. That's wrong approach, there is very limited block for globals and depends on device/os version. Put all into some structure and mmalloc this during INIT action. Then access this structure. Heap is 2-3KB available. See any app example, it's used almost everywhere.
And EEPROM is free'ed during --reset too. |
|
Back to top |
|
 |
|