Hello everybody.
I was reading the Getting Started with FreeRTOSTM BSP for i.MX 6SoloX document and It just explains how to build the demo applications. I know that it is a starting guide and I can't expect much from it other that what it contains. Nevertheless any of the other documents included explain how to "adapt" or in other words, how to modify a demo for porting it to another board as a real starting point into creating custom M4 applications.
The getting started guide is just some explanations about what are the files and folder structure of the BSP but it doesn't explain what to change if needed. So I assumed that since I'm using the same i.MX 6SoloX processor and the only difference is the UART port I'm using vs the UART port that the "Hello World" demo uses, then by just simply changing the port it would work, but it doesn't 
Here is what I did:
First I changed in the board.h file from the following:
#define BOARD_DEBUG_UART_RDC_PDAP rdcPdapUart2
#define BOARD_DEBUG_UART_BASEADDR UART2
#define BOARD_DEBUG_UART_IRQ_NUM UART2_IRQn
#define BOARD_DEBUG_UART_HANDLER UART2_Handler
To the following:
#define BOARD_DEBUG_UART_RDC_PDAP rdcPdapUart4
#define BOARD_DEBUG_UART_BASEADDR UART4
#define BOARD_DEBUG_UART_IRQ_NUM UART4_IRQn
#define BOARD_DEBUG_UART_HANDLER UART4_Handler
And in the pin_mux.c file I added the following along with the already existing UART2 iomux config:
case UART4_BASE:
// UART4 iomux configuration
IOMUXC_SW_MUX_CTL_PAD_SD2_DATA0 = IOMUXC_SW_MUX_CTL_PAD_SD2_DATA0_MUX_MODE(7); /* Rx */
IOMUXC_SW_MUX_CTL_PAD_SD2_DATA1 = IOMUXC_SW_MUX_CTL_PAD_SD2_DATA1_MUX_MODE(7); /* Tx */
IOMUXC_SW_PAD_CTL_PAD_SD2_DATA0 = IOMUXC_SW_PAD_CTL_PAD_SD2_DATA0_PKE_MASK |
IOMUXC_SW_PAD_CTL_PAD_SD2_DATA0_PUE_MASK |
IOMUXC_SW_PAD_CTL_PAD_SD2_DATA0_PUS(2) |
IOMUXC_SW_PAD_CTL_PAD_SD2_DATA0_SPEED(2) |
IOMUXC_SW_PAD_CTL_PAD_SD2_DATA0_DSE(6) |
IOMUXC_SW_PAD_CTL_PAD_SD2_DATA0_SRE_MASK |
IOMUXC_SW_PAD_CTL_PAD_SD2_DATA0_HYS_MASK;
IOMUXC_SW_PAD_CTL_PAD_SD2_DATA1 = IOMUXC_SW_PAD_CTL_PAD_SD2_DATA1_PKE_MASK |
IOMUXC_SW_PAD_CTL_PAD_SD2_DATA1_PUE_MASK |
IOMUXC_SW_PAD_CTL_PAD_SD2_DATA1_PUS(2) |
IOMUXC_SW_PAD_CTL_PAD_SD2_DATA1_SPEED(2) |
IOMUXC_SW_PAD_CTL_PAD_SD2_DATA1_DSE(6) |
IOMUXC_SW_PAD_CTL_PAD_SD2_DATA1_SRE_MASK |
IOMUXC_SW_PAD_CTL_PAD_SD2_DATA1_HYS_MASK;
IOMUXC_UART4_IPP_UART_RXD_MUX_SELECT_INPUT = IOMUXC_UART4_IPP_UART_RXD_MUX_SELECT_INPUT_DAISY(4);
break;
These changes were made because I'm using port 4.
Then I executed the build.sh script for the "Hello World" demo.
~/FreeRTOS_BSP_1.0.0_iMX6SX/examples/imx6sx_sdb_m4/demo_apps/hello_world/armgcc $ ./build_release.sh
Then I took the .bin file, changed the name to m4-freertos.bin, and flashed it to my eMMC card via imx_usb_loader and utp_com because I don't have a sd card in the system.
Then I executed the steps in the 6.1 Running application on TCM with U-Boot section in the Getting Started with FreeRTOSTM BSP for i.MX 6SoloX document and I got the following:
=> fatload mmc 1:7 0x80000000 m4-freertos.bin
reading m4-freertos.bin
13584 bytes read in 12 ms (1.1 MiB/s)
=> dcache flush
=> cp.b 0x80000000 0x7F8000 0x8000
=> dcache flush
=> bootaux 0x7F8000
## Starting auxiliary core at 0x007F8000 ...
=>
But nothing happens in the CORTEX M4 serial terminal.
Also this post i.mx6 solox for dummies doesn't work for me since I'm not using bare metal nor QSPI.
Where can I find a tutorial or example or anything that helps to understand the necessary steps to take in order to create a cortex M4 application, or modify a demo, and "launch" it from u-boot?
I could try this change in the SABRESD board and it's working, I'm getting the "Hello world" string in UART4 so indeed these are the only changes required. What I don't understand is why this is not working on my custom board.
Thanks!!
Message was edited by: Manuel Malagon
Update with the status of my tests.