Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PIC32 MX220] Not enough flash memory
06-11-2013, 05:50 PM,
#11
RE: [PIC32 MX220] Not enough flash memory
Wow. So I don't really have 32 writable kibibytes?

(06-11-2013, 11:28 AM)regis Wrote:
(06-11-2013, 05:10 AM)FlacoDev Wrote: I tried writing a substitute pprint() function in __cdc.c but I'm gonna have to re-write a substitute pprints(), pprintc(), etc...
Take a look at liblcd.c and you won't have to reinvent the wheel.
The best would be to write an apart library with print, printFloat, printNumber, ... that could be used with lcdlib.c, __cdc.c, serial.c, etc ...

I'm gonna take a look at that as soon as possible. Smile
Could be fun if I find the time to work on it.
Reply
06-11-2013, 06:58 PM,
#12
RE: [PIC32 MX220] Not enough flash memory
Well, you sort of do (actually 32+3K in the CPU chip) but lots is already used Sad

I got a linker MAP file and hunted through it and also looked at the input files (procdefs.ld things) to the linker.

I haven't stumbled across where most of the 35K goes to. The bootloader I suppose but a breakdown by size & function and hints about any that might be slimmed down would be useful.

John
Reply
07-11-2013, 09:27 AM,
#13
RE: [PIC32 MX220] Not enough flash memory
Sorry for interfering (and feel free to remove this posting in case it's useless), but I remember the PIC32s have some 16bit-opcode-width mode that would instantly sort-of "free" a certain percentage of flash memory (if not yet activated, of course, and depending on compiler AND program code - AND with a possible impact on execution speed, as we are speaking of different command sets). Did you re-check? Just in case ..
Reply
17-02-2014, 01:23 PM,
#14
RE: [PIC32 MX220] Not enough flash memory
Hi,

I am on OS X 10.9 and I had the same problem as you, when trying to link the CDC library to my program. After digging into the Makefiles I noticed that the code is compiled with -O3 in the Makefile32.macosx. Changing this to -Os yielded another error, which was fixed by adding "-minterlink-mips16", so I can advise you to make sure that you are optimizing your code for size, not for speed. Just take a look what flag the compiler is using and if it is not -Os, change it in the Makefile32 for your platform.

Here is an example of my current flags:

Code:
ELF_FLAGS    =    -EL -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -march=24kc\
                    -msoft-float\
                    -minterlink-mips16\
                    -Wl,--defsym,_min_heap_size=$(HEAP_SIZE)\
                    -Wl,-Map=$(SRCDIR)/output.map\
                    -Wl,-L$(OBJDIR)/\
                    -D __PIC32MX__ -D __$(PROC)__ -D $(BOARD)\
                    -T$(LKRDIR)/procdefs.ld\
                    -T$(LKRDIR)/elf32pic32mx.x
Reply
19-02-2014, 06:52 PM,
#15
RE: [PIC32 MX220] Not enough flash memory
Thanks for this report.
These options are those the makefile32.linux use.
I fixed the makefile32.macosx and will commit a new revision very soon.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)