We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hey everyone,
Very strange problem here. I am using the RL-ARM Flash library.
Essentially, when I include the statment
f = fopen("Test1.txt","r");
it totally fails! The program compiles and programs correctly, but then none of the statements are executed. It's as if using fopen() blows the memory right out of the chip.
More details: I am using the LPC2378 on the MCB2300 board.
I have included FS_ARM_L.lib, RTL.h, File_config.h, LPC2300.s, MCI_LPC23xx.c, file_config.h, as well as files to write to the LCD.
The code is essentially this:
int main() { FILE* f; finit(); lcd_init(); msg("Booted up"); f = fopen("Test1.txt","r"); if( f != NULL) { msg("Opened"); } else { msg("Failed"); } while(1){} }
When I include the fopen statement, I get no messages on the LCD, no lights on the board, nothing happens at all. When I comment it out, I get the messages and it says that it failed to open (because I didn't fopen the file)... which makes sense.
Has anyone experienced anything like this?
Hoping for some help!
Adam :)
do you have enough stack and especially, heap...?
Sorry Tamir, I don't know how to check that. The LPC2378 has 32kB of ram, but I am unsure of how to check if I have enough heap.
I am using the Keil uVision3 IDE.
Sorry. I am a beginner and working on my undergrad thesis. I showed it to my adviser and he has no idea either. Any help would be much appreciated.
have a look at LPC2000.s using its configuration wizard tab. "Heap Configuration" should be the second setting from the top. Mine is set to 0x800 bytes which should be more than enough for you, too.
Hi Tamir,
Thank you for your help. We had not set the heap correctly, but this wasn't the only problem because it still could not work.
I ended up just copying one of their example projects and removed all the parts that I didn't want... and now it is working! Must have been some setting somewhere I didn't know again.
Thank you very much for you help!
The problem was that I had not included the Retarget file.
Thanks again.