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.
Hi!!
I have problem with fopen funciton. I'm using MCB2300 (lpc2378). When I use SD_File examle its work's fine. Now I'm doing my project, I have proglem. I could incialize SD card, but I can't open file (fopen returns error). I have set IRAM2 to addres 0x7FD00000 and size 0x2000, RTLFS.lib (code/cons: default; Zero Initialized Data: IRAM2, Other data: Default)
Default: IRAM1 0x40000000 0x8000 IRAM2 0x7FD00000 0x2000 (USB) RAM1 0x7FE00000 0x4000 (ethernet)
In project I have also included: ETHERNET, DHCP, TELNET, TCP/IP, UDP, TFTP, serial and kernal (from example Http)
I even tried this and don't work:
int main (void) { /* Start with 'init' task. */ FILE *fin; init_serial(); init_card (); fin = fopen ("Test.txt","w"); if (fin == NULL) { send_text ("File not found!\n"); } else { // process file content fclose (fin); send_text ("File OK!\n"); } //os_sys_init(init); while(1); }
Any idea where could be a problem?
Best regard Peter
As you are using the MCB2300, you should have a look to the example projects of the MCB2300, especially to the TFTP_demo. It's using the RAM disk feature of the RL-ARM. So you can take this as an example.
You can find it in the Keil folder in the following path: ..Keil\ARM\Boards\Keil\MCB2300\RL\TCPnet\TFTP_demo
Rainer
I started with this example. I find a problem.
First problem was, that I didn't inicialize defoult mamory. Now I fixed that, but I have problem with RAM size. It's not enough of them. I tried to seperate 32k ram on two parts, one for general prpose (default) other for RAM drive. The minimum od RAM drive is 16k, but other 16k ram is not enough for zero initialized data (just net_config.c needs cca 19k).
At first I would to like learn mora about Memory areas. What is: - code/const - zero initialized data - other data
where must be placed (ROM, RAM) and which part od some function or c file present some area. For example where is put global veriable, ... Have anybody some tutorial? I looked in Kiel help, but I didn't find nothing usefull.
What about using function fread? I know, that you have to correctly set code generation (ARM mode ot Thumb mode) and file Retarget.c. Slowly I understanding how it's work.
Thanke you for your help