8 years, 6 months ago.

Co-existing with SDFileSystem & ConfigFile problam

Hi, I loaded this example in my K64F and it worked well.

I then commented out the all the Ethernet code and added the SDFileSystem library and got the SD Card to work. I then added ConfigFile library and got that to work from a file on the SD card.

Now when I un-comment out the Ethernet code the K64F freezes and wont start.

If I comment/un-comment the Ethernet code one line at a time, up to this line still works; EthernetInterface eth;

Once I un-comment this line, the program won't run. eth.init(MBED_DEV_IP, MBED_DEV_MASK, MBED_DEV_GW); On one occasion I got an error message saying; Error allocating the stack memory.

I have tried various locations for the Ethernet code, even right at the start of 'main' and it just freezes at the eth.init line.

Hoping someone can provide me some guidance here.

Question relating to:

This example uses the mbed libraries to check Ethernet TCP Echo Server Example. EchoServer, ethernet, FRDM-K64F, static ip

I have spent quite a few more hours on this, and found that the code is locking/freezing when it gets to the line in my code; cfg.read("/sd/config.txt");

If I remove the ability for the code (comment it out) to use the ConfigFile library, then Ethernet works. I am not an experienced programmer and have looked through the ConfigFile library code and really can't see why it may be causing problems.

posted by Glendon Turner 24 Sep 2015

Ok, I have been playing a bit more and now it runs without freezing. I have no idea why.

I ended up changing this; static const int MAXCONFIG = 64; static const int MAXLEN_KEY = 64; static const int MAXLEN_VALUE = 128;

to this; static const int MAXCONFIG = 32; static const int MAXLEN_KEY = 32; static const int MAXLEN_VALUE = 64;

All I have done here is reduce the maximum size of the key name and value allowed. Does anyone know why this would unfreeze the code?

posted by Glendon Turner 25 Sep 2015

It looks like I jumped the gun here. It is not working properly, but now gets past the ConfigFile Read command.

It fails to do anything with Ethernet yet. I will keep looking.

posted by Glendon Turner 25 Sep 2015

1 Answer

7 years, 7 months ago.

Hi, I'm looking to get the ConfigFile library to work with the K64F board and I am looking for an example to get me started. As far as I know the ConfigFile library will only work on the LPC1768 board and others, but will not work as-is with the K64F board due to no onboard flash(something like that).

Do you have a working example/configfile library that will work with the K64F board that I can learn from?