This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Writing to SDcard is possible with keil but not with embedded studio

Hello 

I am writing a program using SDK 15.0.0.

I'm trying to merge SPI and TWI programs into BLE programs.

I used keil before to confirm that each program was working properly.
However, since it exceeds 32k bytes when it merges, I decided to use Embedded studio.

TWI and SPI are programs that save the output value from the acceleration sensor to the SD card.

In keil I was able to write to the SD card normally, but in Embedded studio the character was not written.
However, it turned out that the number of bytes originally intended to be written was secured by tab and line feed.
The code is written as “f_write (& file, buf0, 5, (UINT *) & bytes_written);”, but it is possible that keil can write and Embedded studio can not write characters. Is it?
Or simply my lack of settings?

Please tell me ignorant me.

Thank you.

Parents
  • Both Keil & SES are just IDEs with associated toolchains - they are both perfectly capable of generating working code for their intended Targets.

    However, they are entirely different toolchains - so the generated code will not be identical.

    The 3 top suspects would be:

    1. Your SES configuration;
    2. Some (possibly subtle) timing differences;
    3. Some flaw in your code which happens not to show (yet) any visible symptoms in Keil, but does in SES.

    The thing to do is to use the debuggers in both tools to examine what is happening in the working case, and see where the non-working case diverges.

    Also use an analyser or oscilloscope on the interface lines - again, examine what is happening in the working case, and see where the non-working case diverges.

    EDIT

    Have you tried using some unmodified SES examples from the SDK - to get you familiar with the setup, and give you a known-working basis to work from ?

  • Thank you for reply.

    I will try to find out the cause.

    I tried to try the fatfs only example in Embedded studio.
    "L6218E: Undefined symbol __initial_sp (referred from entry2.o)"
    And could not be built successfully.
    I do not know the cause of this either.

  • I was able to compile the fatfs example in Embedded studio, but running it did not write numbers to the SD card.
    Blanks were written instead of numbers.
    I do not know the cause of this
    Help me...

  • fatfs only example

    Do you mean the SD Card Example from the SDK? If you get errors building this in SES, you should try with a fresh copy of the SDK, to make sure you did not modify anything.

    If you are still not able to write the SD card, please check the connections, or test with a different card. Are you using an SD card socket board? If you are, please make sure it does not contain a 5 V level shifter.

  • I do not know the cause of this

    You need to find the cause - that's what debugging is all about!

    Again:

    The thing to do is to use the debuggers in both tools to examine what is happening in the working case, and see where the non-working case diverges

    And:

    use an analyser or oscilloscope on the interface lines - again, examine what is happening in the working case, and see where the non-working case diverges

    (can't get the stupid forum to do that in a single quote)

    Debugging is a key part of software development - and, in fact, any kind of development!

    How To Debug

  • Thank you for reply,jorgen!

    Yes. I am using fatfs_example of SDK 15.0.0 as a sample to write to the SD card.
    It works fine with keil, but not with SES.
    In SES, there are no errors or warnings at compile time, but you can see that it is not working properly if executed.
    Although BLE and nrf_gpio_pin_set () etc are working normally, only SPI is not working properly in SES.

    I have a question here,
    I have already edited the fatfs in SDK 15.0.0, so I downloaded SDK 15.3.0 to run the unedited sample in SES.
    However, the fatfs of SDK 15.3.0 could not be run with keil. Are there any restrictions that only one version of SDK can be used per chip?

  • SPI is not working properly

    What, exactly, is "not working" ?

    http://www.catb.org/esr/faqs/smart-questions.html#code

    Again, have you looked at the SPI lines on an analyser or oscilloscope?

    Have you compared the working & non-working versions - both within the software, and looking at the hardware - to find where they diverge?

    only one version of SDK can be used per chip

    The chip can only run 1 executable at a time.

    An executable can only be built from 1 SDK.

Reply Children
Related