Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
WeGa_288606
Level 4
Level 4
25 sign-ins 10 sign-ins 5 sign-ins

Hi, 

I using the emFile example. The example uses cyreservedresources.list to reserve sdhc[0]. We have an eMMC device connect to pins on SHDC1 thus  changed sdhc[0] to sdhc[1] in this file. However, I need to change the code to use sdhc[1] but I cannot seem to find out where this is done? This project does not use the device configurator to configure the SDHC peripheral. We are using 8 bit wide eMMC. The closest I have found is perhaps as follows :

WeGa_288606_0-1676617576336.png

With the default settings above the code outputs the following to the UART:

WeGa_288606_1-1676617754776.png

If I change the code to use HW layer "1" instead of "0" (Guessing that this may have pointed to SDHC1 instead of SDHC0??)

WeGa_288606_3-1676617904891.png

 

The execution stops as follows:

 

WeGa_288606_2-1676617838530.png

 

Any ideas on where I should look to use SDHC1 rather than SDHC0? SDHC0 does not support the 8 bit wide data/bus. 

 

0 Likes
9 Replies
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @WeGa_288606 

Can you please try changing the boolean variable isEmmc from false to true(.isEmmc = true) in the FS_ConfigMMC_CM_HS.c file as shown?

LeoMathews_0-1676631115011.png

Please change it to true and let me know if the issue persists.

Thanks and Regards,
Leo

0 Likes

Hi Leo, 


We had already set the SDConfig as follows with the results per the original post. 

 

WeGa_288606_0-1676645388828.png

 

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @WeGa_288606 

I believe the cyreservedresources.list should be modified with the exact pin configurations that were used for interfacing the sdhc[1] with the 8 bit wide eMMC. Can you please share the pin connections that you used for interfacing the 8 bit wide eMMC with sdhc[1]? Also can you please try modifying the same with the correct pin configurations and check if it is interfaced correctly?

Thanks and Regards,
Leo

0 Likes

Hi Leo, 

I added to the reserved resource list but the results are the same. The PIN connections are as follows:

 

WeGa_288606_0-1676917354839.png

 

I am unclear on what you mean by "Also can you please try modifying the same with the correct pin configurations and check if it is interfaced correctly?" There are only one set of pins allowed for interfacing with SHDC[1] and no other choices. Per the device configurator for example as follows :

 

WeGa_288606_1-1676917519565.png

PS I am using the Device Configurator just for illustrative communications in the posts but for the SDHC1 I am not using Device Configurator for generating the code. Just using the emFile code structure/example "as is" with the change from SDHC0 to SDHC1 and 8 bit wide. 

0 Likes

Hi @LeoMathews 

Would you happen to have an update on this topic at all?

Thank you, 

Wess

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @WeGa_288606 

Apologies for the delayed response. I was trying to recreate the issue from my end. Can you please try to configure the SD host and initialize the card in you main.c file by adding this code?

/* Allocate context for SD Host operation */
    	cy_stc_sd_host_context_t sdHostContext;

    	/* Populate configuration structure */
    	const cy_stc_sd_host_init_config_t sdHostConfig =
    	{
    	    .dmaType = CY_SD_HOST_DMA_SDMA,
    	    .enableLedControl = false,
    	    .emmc = true,
    	};


    	/* Configure SD Host to operate */
    	result = Cy_SD_Host_Init(SDHC1, &sdHostConfig, &sdHostContext);

 

cy_en_sd_host_card_type_t cardType;
    		uint32_t rca;
    		cy_en_sd_host_card_capacity_t cardCapacity;


    	/* Populate configuration structure */
    		cy_stc_sd_host_sd_card_config_t sdCardConfig =
    		{
    		    .lowVoltageSignaling = false,
    		    .busWidth = CY_SD_HOST_BUS_WIDTH_8_BIT,
    		    .cardType = &cardType,
    		    .rca = &rca,
    		    .cardCapacity = &cardCapacity,
    		};

    		/* Initialize the card */
    		(void) Cy_SD_Host_InitCard(SDHC1, &sdCardConfig, &sdHostContext);

 

Thanks and Regards,
Leo

 

 

0 Likes

Hi @LeoMathews 

I was just about to post another question somewhat related to the code you shared. Would you please explain SDHC_Type*? I dont see it documented in the PDL beyond what Doxygen/Code Doc is producing. I see in your code example you are using SDHC1 but the emfile example is using it/passing it a bit differently and not so explicitly as in your code. 

WeGa_288606_0-1677134778351.png

 

 

0 Likes
WeGa_288606
Level 4
Level 4
25 sign-ins 10 sign-ins 5 sign-ins

Hi @LeoMathews 

It appears that even the most basic example code for SDHCx from the HAL or PDL generate some kind of fault as similarly reported by this recent post https://community.infineon.com/t5/PSoC-6/quot-SDHC-CORE-EMMC-CTRL-R-base-quot-generates-a-fault-in-C... 

I have reproduced the posts problem per their example project attached to their post on CY8CPROTO-062-4334W. 

0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @WeGa_288606 

I have recreated the fault as mentioned in the other thread. I will report the same internally for a fix.

Thanks and Regards,
Leo

0 Likes