Part Number: AM2434
Other Parts Discussed in Thread: SYSCONFIG
The system is FreeRTOS.Can the mode of sdio be set? Where can the 4-bit mode and 1-bit mode be set in the code.
Hi,
Yes, the sdio mode can be configured, and this is done through SysConfig.
In SysConfig, navigate to the MMCSD section. By default, the driver selects the maximum supported speed and bus width automatically.
To manually configure the bus mode:
Open the MMCSD instance in SysConfig.
Disable the option “Auto assign maximum speed”.
Once this option is disabled, you will be able to explicitly select the bus width (1-bit or 4-bit mode) from the available configuration options.
I’ve attached a screenshot for reference showing where this option can be found in SysConfig.

Hi,
The suggestions above regarding changing the bit positions seem acceptable.
I’ve attached a screenshot for reference showing where this option can be found in SysConfig.

For the SDIO configuration, you would need to manually setup the required MMCSD instance and the pinmux configurations. This can be implemented in a similar way to what happens in the System_init() API that is given. Instead of the default MMCSD_init() API, you can make a custom API with the changes required for SDIO. In this setup itself, you would be able to setup the attributes for the SDIO including 1 bit or 4 bit mode.
You could also take reference from the Linux implementation of SDIO on the Processor SDK.
The SDIO mode is however, not supported in the MCU+SDK and must be tested on the customer's side.
If you modify inside the MMCSD_init which is present in the System_init API - it will get overwritten - as that is generated code. You would need to create seperate files similar to the image:

The files would also need to be added to the makefile of the example, so its compiled. Additionally, do make sure the MMCSD instance in that is opened in the default MCU+SDK flow is closed or removed such that there is no error in opening this instance.
The init API in itself does not need modification, rather the configurations that are being used in the init:

Along with above configurations, the pinmux is also configured seperately like below:

Please verify the correct pinmux configurations from the AM243 Datasheet as SDIO is not tested.