This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

F28M35H52C: Updating FatFs from v0.04b to 0.13b

Part Number: F28M35H52C
Other Parts Discussed in Thread: SYSBIOS,

I am trying to add SD card functionality to my design (non SYSBIOS) and I have got the sd_card_m3 example to work.  I want to update to the 11 year more up to date version of FatFs available here http://elm-chan.org/fsw/ff/00index_e.html and I'm struggling with the updates to the mmc-concerto.c file which is the equivalent for the mmc.c file in the FatFs documentation.  There are several new functions added so I figured the best approach would be to modify the existing mmc-concerto.c file.

My hardware is the same as the ControlCard except that I'm using SSI2 rather than SSI0 but that chage has already been sucessfully adapted to with running 0.04b code.

Has anyone already done this and, if so, is there any chance of getting hold of an updated mmc-concerto.c file?

If not, I'd like to get advice as to which file is the closest in the ffsample.zip - to start with, the old 0.04b version of mmc-concerto.c #defines all commands with 0x40 added like this...

#define CMD10    (0x40+10)    /* SEND_CID */

but the example file for the stm32f1 #defines it like this...

#define CMD10 (10) /* SEND_CID */

So I don't get why the extra bit is being set.

Any guidance or assistance is much appreciated.

Ted

  • Let me take a look at the source code and get back to you. 

    As far as the constant CMD10 being 0x40 + 10 in our code vs just 10 for STM, this is just a simple difference between the style of coding. I am sure the STM code will add 0x40 to all CMDx before actually sending them.

    For example the snippet of code below is for another brand of MCUs (not TI or STM) and they chose to include the 0x40 in the #define.

  • Thanks for the fast reply, I'm still looking at my code but there's a lot that's changed in the last 11 years as far as SD card support goes so I'd much prefer to have the latest SD code running on my f28m35h52c. There's extra commands (to what's in the old mmc-converto file) such as
    #define ACMD41 (0x80+41) /* SEND_OP_COND (SDC) */
    that deals with SDHC and higher capacity cards. It's likely these commands are going to be handled in a special way to make sure that the FatFs drivers all work properly.
  • Ted,

    I dug into the demo applications from the elm-chan site and it looks like what Nima had mentioned is correct.
    the extra bit is set in within the send_cmd() function in the stm32 example (elm-chan.org/.../ffsample.zip ) , but the c28x port pulls it into the actual command #define. Seems to just be how we ported the code way back when it was done.

    I will note that I have filed a request to get the latest FatFs version ported. I have no idea when/if the port will happen, but it is logged as a request.
  • Mark,

    Thanks for the clarification; I've looked more at mmc-concerto.c and some of the other examples for other CPUs like mmc_stm32f1_spi.c and it seems fairly close to the TI Concerto adaptation - given this is 'only' 650 lines of code, I think I'm going to try to do the port myself - can I come back to this thread for support if I run into unforeseen issues?

    Ted
  • Ted,

    If there are specific SPI questions or any general C2000 questions, I would suggest that you create new threads. The E2E forums are better searched if each thread is a unique topic.

    If you close the thread (by clicking the green button), you will see a new button appear that is "Ask a related question" This will link the two so there is background for the next person to reply, but it will be a different thread.

    Thanks, and happy porting :)

    If you are able to successfully port the code, please don't hesitate to post the code for others.

    -Mark

  • Thanks Mark, I will raise a new thread for any follow on questions.

    Ted