Over the last few weeks, I’ve been setting up Photon and playing around with it. At this point, I have been able to build firmware locally and flash it to my Photon device. I am trying out an application, which will need an array of about 4K elements, of type integer. This is taking away 16KiB of SRAM, leaving less than 4KiB for the rest of the program (program stack and Heap). I sometimes see RED flashes on Photon, and I believe I am running into memory-not-available-issue.
I have been looking into the Linker Scripts, and I see that the SRAM layout is defined in part1.ld, part2.ld and user.ld under firmware/modules/. Now that I have set the context briefly, I have the following questions.
- Where can I find the complete 128KiB SRAM internal memory map? Where exactly does the Firmware code and data sit? Which all addresses are mapped to User SRAM space?
- Can I look at increasing the User SRAM, by modifying ONLY the Linker scripts? Are there any other files that needs to be modified? How easy/difficult is that? (of course, after carefully looking at the memory footprints).
- Has anyone experienced similar issues before?
In general, I am looking at having more memory to use on Photon device. I do understand that such a huge array in my application, is something to re look at, but 20KiB looks too less for me any which way. I couldn’t find any other thread on the same topic. Please do let me know of any pointers, that can help me.