-
Notifications
You must be signed in to change notification settings - Fork 22
Libmc1322x developers guide
Here is some ram usage information from the nvm_read program:
12272 nvm_read
10224 nvm_read without rom calls (2048 bytes)
8060 nmv_read without printf (2164)
3036 without uart_init (and all the uart related buffers etc.) (5024 bytes)
There is currently a 1.7kB space reserved for the rom_vars
. This area of RAM is allowed to be used by the various routines in the ROM. The space is reserved in the start.S:
.org 0x120
ROM_var_start: .word 0
.org 0x7ff
ROM_var_end: .word 0
#endif /*USE_ROM_VARS*/
Currently, the only critical functions performed by ROM calls are the nvm_* routines and there isn't a particular reason why these have to be ROM calls. get_lqi
in maca.c is also a ROM call.
There are two approaches here:
- Isolate the RAM locations necessary for the ROM calls used and only reserve them.
- Re-implement the rom calls.
Neither option is particularly difficult. The largest RAM gains would probably come from isolating the rom_vars currently used (unless the ROM code is doing something bad like allocating big buffers).
####Compiler link
####From Tyler:
I think it works just fine. Download the latest code sorcery compiler... turn off all the 'interworking'
stuff in the makefile (interworking is default now)... leave the '-mthumb' thingy (ROM calls are thumb I
guess)... and apply the 'Mar Fix' to start.S (to get into Thumb) and you are all set.
I have only experimented on an econotag. I wrote a program (a libmc1322x test program) to play with the
nvm_* routines. I was able to detect/read/write/erase nvm. I was able to get rftest-rx/tx to talk to one
another. Also, I was able to compile the backpack code and get it to boot up on an econotag. I just
haven't run anything on my own hardware.
####The "mar fix" to start.S:
The jump to main in start.S needs to become:
ldr ip, main_addr
bx ip
main_addr:
.word main
Not sure if this code will still work on the old compiler (but I think it will).
There are various places where there are unused variables (e.g. i2c and maca). These need:
__attribute__((unused))
Then pwm.c has an error with the assembly unless the following is used:
-fno-strict-volatile-bitfields
© 2013 Mariano Alvira. Distributed under the GNU FDL v1.3 <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-9770084-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>