Post Reply 
newRPL: [UPDATED April 27-2017] Firmware for testing available for download
11-17-2015, 01:06 AM
Post: #121
RE: newRPL: [UPDATED Nov-14-2015] Firmware for testing available for download
(11-16-2015 04:45 PM)Han Wrote:  Wait so does the OFF key work only in x49gp? or is it now working on the real hardware?

EDIT: Answered my own question with a firmware upgrade: Yes, OFF works in real hardware. But another question: what was it that was the key to getting OFF to work (just out of curiosity)

It wasn't a bug at all!
Here's the story:
To make things easier, I use Qt Creator as an IDE, even for cross compiling. As a side effect, my setup automatically added a compiler option -fPIE, which I wasn't aware of (it was nowhere in my project files).
This option was creating tables in a special section in the ELF file (.got tables), which weren't properly extracted into the ROM binary file (because they weren't supposed to be there in the first place).
So newRPL was working by miracle, many of the global variables were being redirected to ROM because they were "reading" this inexistent table.
Writing to ROM was working as RAM because the caches were enabled, so everything appeared to work fine on the surface.
I can't explain why the OFF function didn't work (I suspect the caches holding data supposed to be written to ROM had something to do with that), but removing that compiler option not only fixed the OFF function, but also my flash driver started communicating with the ROM chip properly, so it killed two in one shot.
I had been hunting that bug for months, and it turns out it wasn't a bug in my code, it wasn't even something I voluntarily added to the compiler.
I now added a few lines in the project file that remove all options that Qt Creator passes to the compiler without consent.

Another lesson learned the hard way.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: newRPL: [UPDATED Nov-14-2015] Firmware for testing available for download - Claudio L. - 11-17-2015 01:06 AM



User(s) browsing this thread: 4 Guest(s)