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.

MCU-PLUS-SDK-AM263X: MMCSD not working - bugged or missconfig?

Part Number: MCU-PLUS-SDK-AM263X
Other Parts Discussed in Thread: SYSCONFIG, LP-AM263

Tool/software:

Hi

Had a working project with SDK 9 which could read/write SD cards via FREERTOS-FAT and MMCSD, now upgraded to SDK10 (with compiler, sysconfig etc. too). Devboard is LP-AM263.

Since with the new SDK does not works started to check what happens:

 - linked FF_PRINTF to _DebugP_logZone I noticed the FF_Mount is not working anymore (seems to read lot of 0's in the background).

This for me hints the direction that the culprit is the MMCSD driver and not the Freertos-fat.

To do a doublecheck I did a pure MMCS test with the project C:\ti\mcu_plus_sdk_am263x_10_00_00_35\examples\drivers\mmcsd\mmcsd_raw_io
I get read error (and I have to mention that I did tried older sdk, older syscfg variant and that still can read files so the SD card is there and working):

There are two things which puzzles me:
- if I open the sycfg I get a screen like this:

which means the example project was never opened and updated to the new sycfg required by the new SDK 10.x (my syscfg is 1.21.1, tried with 1.21.0 no success either).

- the mmcsd configuration has a lot of new stuff on the config screen (comparing to the older sdk and sycfg 1.19).

One is the clock which is not a direct number anymore but a selector. One thing wrong here and it could cause the MMCSD to not work which I am experiencing.

Is there a working project which has MMCSD setup correctly to have a SD card working? 

Or can anyone update the project from this thread to have it working? 

Have to mention that we also have problems with ADC0 (freezes the whole system in ti driver init) thus this migration is not fun (and we have to because of the MCAN issues fixed in SDK10).
So any help is appreciated to have it migrated properly.

Best regards,

Barna Csenteri

  • Hi Barna,

    The mmcsd_raw_io project works find on my CC card.

        

    I used SDK 10.0.0.35, and 1.21.0 SysConfig:

    The CCS used is 12.8 and the compiler is Clang v4.0.0.LTS.

  • Hi 

    Can you give me your project? I did tried this projects:

    and neither is working.

    I suppose you used the 1st one? For that I get this:
    [Cortex_R5_0] ASSERT: 0.287s: mmcsd/v1/mmcsd_v1.c:MMCSD_open:254: status == SystemP_SUCCESS failed !!

    on my CC card

    I have the LP devboard, not the CC. As far as I see there is no difference on the MMCSD level, needs the same GPIO to be input pulled up but who knows.

    I also have to mention that I need to recompile the kernel because the configNUM_THREAD_LOCAL_STORAGE_POINTERS as it is set in the SDK is not enough for almost anything (FREERTOS-FAT already needs 7). Nothing changed in the MMCSD side (the kernel has just this THREAD count increased and the FREERTOS-FAT is recompiled for FREERTOS instead of no-rtos but that should not affect MMCSD raw io). The whole setup works ok for SDK9.

    I do recompiled the whole SDK with sysconfig 1.21.0 (I had 1.21.1 before) but still not good.

    For recompiling I use this commands from a windows prompt:

    set PATH=%PATH%;c:\ti\ccs1280\ccs\utils\bin
    c:
    cd C:\ti\mcu_plus_sdk_am263x_10_00_00_35

    echo "===== REBUILDING KERNEL ====="
    gmake -sj -f makefile.am263x freertos_r5f.ti-arm-clang_clean
    gmake -sj -f makefile.am263x freertos_r5f.ti-arm-clang
    gmake -sj -f makefile.am263x freertos_r5f.ti-arm-clang_clean PROFILE=debug
    gmake -sj -f makefile.am263x freertos_r5f.ti-arm-clang PROFILE=debug

    echo "===== REBUILDING DRIVERS ====="
    gmake -sj -f makefile.am263x drivers_r5f.ti-arm-clang_clean
    gmake -sj -f makefile.am263x drivers_r5f.ti-arm-clang
    gmake -sj -f makefile.am263x drivers_r5f.ti-arm-clang_clean PROFILE=debug
    gmake -sj -f makefile.am263x drivers_r5f.ti-arm-clang PROFILE=debug

    No errors, the libs are recreated (both release and debug). Is it anything wrong with it?

    imports.mak is like this (as far as I remember is unchanged):

    DEVICE ?= am263x
    ifeq ($(OS),Windows_NT)
        TOOLS_PATH?=C:/ti
        CCS_PATH?=$(TOOLS_PATH)/ccs1280/ccs
        CCS_ECLIPSE=$(CCS_PATH)/eclipse/eclipsec
        CYGWIN_PATH?=$(CCS_PATH)/utils/cygwin
        MKDIR=$(CYGWIN_PATH)/mkdir -p
        RMDIR=$(CYGWIN_PATH)/rm -rf
        RM=$(CYGWIN_PATH)/rm -f
        COPY=$(CYGWIN_PATH)/cp
        MOVE=$(CYGWIN_PATH)/mv
        CAT=$(CYGWIN_PATH)/cat
        SED=$(CYGWIN_PATH)/sed
        TOUCH=$(CYGWIN_PATH)/touch
        PATHSEP=\\
        CHMOD=$(CYGWIN_PATH)/echo
        SHELL=cmd.exe
    else
        UNAME_S := $(shell uname -s)
        ifneq (,$(filter $(UNAME_S),Linux Darwin))
            export TOOLS_PATH?=$(HOME)/ti
            export CCS_PATH?=$(TOOLS_PATH)/ccs1280/ccs
            export CCS_ECLIPSE=$(CCS_PATH)/eclipse/eclipse
            export MKDIR=mkdir -p
            export RMDIR=rm -rf
            export RM=rm -f
            export COPY=cp
            export MOVE=mv
            export CAT=cat
            export SED=sed
            export TOUCH=touch
            export PATHSEP=/
            export CHMOD=chmod
        endif
    endif
    
    CGT_TI_PRU_PATH=$(TOOLS_PATH)/ti-cgt-pru_2.3.3
    CGT_TI_ARM_CLANG_PATH=$(TOOLS_PATH)/ti-cgt-armllvm_4.0.0.LTS
    ifeq ($(wildcard $(CGT_TI_ARM_CLANG_PATH)),)
        CGT_TI_ARM_CLANG_PATH=$(TOOLS_PATH)/ti-cgt-armllvm_4.0.0.LTS
    endif
    CCS_NODE = $(CCS_PATH)/tools/node/node
    SYSCFG_PATH ?= $(TOOLS_PATH)/sysconfig_1.21.0
    SYSCFG_CLI_PATH ?= $(SYSCFG_PATH)
    SYSCFG_NODE = $(SYSCFG_PATH)/nodejs/node
    SYSCFG_NWJS = $(SYSCFG_PATH)/nw/nw
    SYSCFG_SDKPRODUCT=$(MCU_PLUS_SDK_PATH)/.metadata/product.json
    

  • Just for the sake of the testing I did put back the 6 libs we recompile from a freshly installed 10.0.0.35 to have them in the original.

    I still get that assertion on the LP board.

  • Hi Barma,

    I will zip my example, then post it for you.

  • This is the example I used for testing SD card on control card.

    mmcsd_raw_io_am263x-cc_r5fss0-0_nortos_ti-arm-clang.zip

  • Hi

    Took the project, installed everything on a brand new machine (no prior TI kits installed).

    The devboard is the official LP-AM263, not your CC board. This might matter.

    [Cortex_R5_0] ASSERT: 0.734s: mmcsd/v1/mmcsd_v1.c:MMCSD_open:254: status == SystemP_SUCCESS failed !!!

    Exactly the same devboard, same SD card (no HW changes, the board is the same PCB), using SDK9, compiler 3.0.0 and Sysconfig 1.20:

    This shows me that the CC and LP projects are not compatible - the CC project will not work on the LP board (even if the EMMC pins, EMMC settings, SD CARD ENABLE PIN is the same). I do not know why.

    So probably we should not expect to have it working with SDK10 either.

    To doublecheck I did took the LP project on the newly installed SDK10 machine:

    Did try without opening the syscfg, than I opened it (to have it ported to new sysconfig) - neither works.

    So it seems the LP board does not works with SDK10, the CC might since it works for you but I can't doublecheck that. 

    Best regards,

    Barna

  • Hi Barna,

    I just try the MMCSD RAW IO in SDK10 on AM263LP, it works on R5FSS0-0. 

    1. 16GB SD card

    2. Bootmode is DevBoot, SW1[4:1]=b0100

    3. AM263x GEL is used 

    4. SDK: 10.0.0.35

    5: CCS: 12.8 with CLANG 4.0.0.LTS, without opening the sysconfig

  • Hi

    The one on the left works, the one on the right does not (both works with SDK9).
    Same speed grade. Any idea what can be different between the two RAW MMCSD wise?

    Where can I change this clock? 

    I just want to try a low-er speed - the old SDK9 had a direct number there what I could change, now is a selector what I do not know where is defined. Tried both versions but the CORE one I guess is even higher.

    Best regards,

    Barna Csenteri

  • Hi Barna,

    If you use GEL files, you can modify the peripheral clocks by changing the dividers in hotmenu Program_Per_PLL() in AM263_PLL.gel file.

    PLL_PER_HSDIVIDER_CLKOUT1 is = OSC (25MHz) * M /[(N+1) * N2 * M2 * HSDIVDER] 

    Where PLL = M * CLKINP / [(N+1) * M2],   In gel file, M=0x300, N=9, M2=1, and CLKINP=25MHz   --> CLKOUTLDO=1920MHz

  • The PER_HSDIV0_CLKOUT1 can also be change by SysCOnfig generated function in ti_power_clock_config.c:

  • The PER_HSDIV0_CLKOUT1 can also be change by SysCOnfig generated function in ti_power_clock_config.c:

    That file is regenerated on every build, any change is deleted (since this file is autogenerated) so this will not work.

    And I think not the clock source should be modified but the individual clock per peripheral. 

    For example we use a lot of peripherals in the same time and all of them use the same DDL_PER_HSDIV0 _CLOCKOUT0 (or CLOCKOUT1) like this:

    If I modify the clock source it will trash the rest of them using the same clocksource.

    I would need to modify that 192000000, not the SOC_RcmPeripheralClockSource_DPLL_PER_HSDIV0_CLKOUT1.

    Or CLKOUT1 is the same freq everywhere?
    If yes I start to wonder if gSocModulesClockFrequency is correct this way having more frequencies for the same CLKOUT1 - would that even work? Based on your drawing there is one CLKOUT1 not 3 like in this autogenerated SOC_ModuleClockFrequency array. Am I missing something?

    If you use GEL files, you can modify the peripheral clocks by changing the dividers in hotmenu Program_Per_PLL() in AM263_PLL.gel file.

    Where is this GEL file located? We started from the "empty" multicore project from the "SDK" and I can't find any GEL file. I remember I can set something up for debug but I really need those values in the final binary compiled file as well otherwise it will not work - just for debug is not enough.

    EDIT: meantime I found SOC_rcmGetClkSrcAndDivReg in the sourcecode which uses the same CLKOUTx source and different dividers for every peripheral so this is a bit more clear but I still need a way to somehow at least select the divider (to get a lower speed in the firmware).

    Best regards,

    Barna Csenteri

  • Where is this GEL file located?

    C:\ti\ccs1280\ccs\ccs_base\emulation\gel\AM263x

    Are you going to change the MMC functional clock (MMC_FCLK)? MMC_FCLK=192/div, where div is CLKDIVR of MMC0_CLK_DIV_VAL register.

  • This GEL file runs only from debugger correct? Or also the *.appimage files will have the change applied in the gel file?

    I need a way to select the MMC clock divider (to reduce the clock rate) to a lower speed which will has it's effect also when the firmware is loaded from QSPI Flash. 

    What we use to run the firmware in the final product is described here: https://software-dl.ti.com/mcu-plus-sdk/esd/AM263X/10_00_00_35/exports/docs/api_guide_am263x/TOOLS_FLASH.html#TOOLS_TI_UNIFLASH_TOOL

  • Is there any way of going around missing features of the SYSCFG where the autogenerated files are not ok?

    In this case I can't set frequency for SD card, another issue if I switch to EMMC (since we will use both in different products) the MMCSD_initEMMC does not calls any MMCSD_setBusVolt for MMCSD_BUS_VOLTAGE_3_3V thus the EMMC will not work (had to introduce new lines manually in the sycfg to force the 3_0V setting).

    So what is the most straightforward way to fix those parameters when SYSCFG does not provide them? And to not get deleted at every rebuild which it happens for the autogenerated sources.