Tool/software: TI-RTOS
Dear TI support.
Currently we are trying to run some simple examples on VAR-SOM-AM43 with carrier board VAR-AM43CustomBoard. I know that you don't have direct support for those boards but I don't see any differences for case if I want to support custom board. Anyway IDK dev. board is on way because of all problems that I have with porting and running simple examples.
First of all I am a bit confused because i can't found porting guides for porting AM437x SOC with TI-RTOS SDK.
I found starting guide . Then try to run some simple example. With semi-hosting examples run without problems.
Then i try PDK examples.
1.)VAR-AM43CustomBoard and GpevmAM437x has USART0 on the same pins, so i try run example in CCS (import "UART_BasicExample_evmAM437x_armExampleProject" made with pdkProjectCreate.sh). No output and program hangs in UART_gets.
Did i miss some generalsettings of projecti?
2.)Then I decide to make pinmux because VAR-AM43 is without rtsn and ctsn signals on UART. Because TX pin did not rise on idle state (after init) I decide to change STDIO instance to 2 -> UART2 (rs-232 port on VAR-AM43CustomBoard).
I start watching TI Training for AM437x and on "Board Library: Modifying Source for Custom Platform" but there are instructions for porting AM572x :(
I found some instructions for UART changing on BBB so i realize that changes must be done in packages\ti\starterware\board\am43xx, packages\ti\starterware\soc\am43xx, and packages\ti\board\src\evmAM437x.
So I made pinmux with minimum needed pins for test - see attached file.
/**
* Note: This file was auto-generated by TI PinMux on 6/28/2017 at 11:34:11 AM.
*
* \file am43xx_pinmux_data.c
*
* \brief This file contains the pin mux configurations for the boards.
* These are prepared based on how the peripherals are extended on
* the boards.
*
* \copyright Copyright (CU) 2017 Texas Instruments Incorporated -
* http://www.ti.com/
*/
/**
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/* ========================================================================== */
/* Include Files */
/* ========================================================================== */
#include "types.h"
#include "pinmux.h"
#include "am43xx_pinmux.h"
/** Peripheral Pin Configurations */
#ifndef BUILDCFG_MOD_GPIO
#define BUILDCFG_MOD_GPIO
#endif /* BUILDCFG_MOD_GPIO */
#ifndef BUILDCFG_MOD_UART
#define BUILDCFG_MOD_UART
#endif /* BUILDCFG_MOD_UART */
#if defined(BUILDCFG_MOD_GPIO)
static pinmuxPerCfg_t gGpio4PinCfg[] =
{
{
/* My GPIO 4 -> gpio4[8] -> AD24 */
PIN_CAM1_DATA8, 8, \
( \
PIN_MODE(7) | \
((PIN_PULL_UD_DIS | PIN_PULL_UP_EN | PIN_RX_ACTIVE | PIN_DS_VALUE_OVERRIDE_EN | PIN_DS_OP_DIS | PIN_DS_PULL_UP_EN) & \
(~PIN_DS_OP_VAL_1 & ~PIN_DS_PULL_UD_EN & ~PIN_WAKE_UP_EN))
) \
},
{
/* My GPIO 4 -> gpio4[26] -> AE19 */
PIN_CAM0_DATA4, 26, \
( \
PIN_MODE(7) | \
((PIN_PULL_UD_DIS | PIN_PULL_UP_EN | PIN_RX_ACTIVE | PIN_DS_VALUE_OVERRIDE_EN | PIN_DS_OP_DIS | PIN_DS_PULL_UP_EN) & \
(~PIN_DS_OP_VAL_1 & ~PIN_DS_PULL_UD_EN & ~PIN_WAKE_UP_EN))
) \
},
{PINMUX_INVALID_PIN}
};
static pinmuxModuleCfg_t gGpioPinCfg[] =
{
{4, TRUE, gGpio4PinCfg},
{CHIPDB_INVALID_INSTANCE_NUM}
};
#endif /* if defined(BUILDCFG_MOD_GPIO) */
#if defined(BUILDCFG_MOD_UART)
static pinmuxPerCfg_t gUart2PinCfg[] =
{
{
/* MyUART2 -> uart2_rxd -> P23 */
PIN_SPI0_SCLK, 0, \
( \
PIN_MODE(1) | \
((PIN_PULL_UD_DIS | PIN_PULL_UP_EN | PIN_RX_ACTIVE | PIN_DS_VALUE_OVERRIDE_EN | PIN_DS_OP_DIS | PIN_DS_PULL_UP_EN) & \
(~PIN_DS_OP_VAL_1 & ~PIN_DS_PULL_UD_EN & ~PIN_WAKE_UP_EN))
) \
},
{
/* MyUART2 -> uart2_txd -> T22 */
PIN_SPI0_D0, 0, \
( \
PIN_MODE(1) | \
((PIN_PULL_UD_DIS | PIN_PULL_UP_EN | PIN_DS_VALUE_OVERRIDE_EN | PIN_DS_OP_DIS | PIN_DS_PULL_UP_EN) & \
(~PIN_RX_ACTIVE & ~PIN_DS_OP_VAL_1 & ~PIN_DS_PULL_UD_EN & ~PIN_WAKE_UP_EN))
) \
},
{PINMUX_INVALID_PIN}
};
static pinmuxPerCfg_t gUart0PinCfg[] =
{
{
/* MyUART0 -> uart0_rxd -> K25 */
PIN_UART0_RXD, 0, \
( \
PIN_MODE(0) | \
((PIN_PULL_UD_DIS | PIN_PULL_UP_EN | PIN_RX_ACTIVE | PIN_DS_VALUE_OVERRIDE_EN | PIN_DS_OP_DIS | PIN_DS_PULL_UP_EN) & \
(~PIN_DS_OP_VAL_1 & ~PIN_DS_PULL_UD_EN & ~PIN_WAKE_UP_EN))
) \
},
{
/* MyUART0 -> uart0_txd -> J24 */
PIN_UART0_TXD, 0, \
( \
PIN_MODE(0) | \
((PIN_PULL_UD_DIS | PIN_PULL_UP_EN | PIN_DS_VALUE_OVERRIDE_EN | PIN_DS_OP_DIS | PIN_DS_PULL_UP_EN) & \
(~PIN_RX_ACTIVE & ~PIN_DS_OP_VAL_1 & ~PIN_DS_PULL_UD_EN & ~PIN_WAKE_UP_EN))
) \
},
{PINMUX_INVALID_PIN}
};
static pinmuxModuleCfg_t gUartPinCfg[] =
{
{2, TRUE, gUart2PinCfg},
{0, TRUE, gUart0PinCfg},
{CHIPDB_INVALID_INSTANCE_NUM}
};
#endif /* if defined(BUILDCFG_MOD_UART) */
/** EVM pin configurations for EVM */
pinmuxBoardCfg_t gGpevmPinmuxData[] =
{
#if defined(BUILDCFG_MOD_GPIO)
{CHIPDB_MOD_ID_GPIO, gGpioPinCfg},
#endif /* if defined(BUILDCFG_MOD_GPIO) */
#if defined(BUILDCFG_MOD_UART)
{CHIPDB_MOD_ID_UART, gUartPinCfg},
#endif /* if defined(BUILDCFG_MOD_UART) */
{CHIPDB_MOD_ID_INVALID}
};
Then progress stop in line of instructions:
To modify the power and clocking, do as follows:
1. Add a clocking instance for UART1 in the PRCMModuleEnable() routine to file
${PDK_INSTALL_DIR}packages\ti\starterware\soc\am335x\am335x_prcm.c.
case 1: enableModule (SOC_CMPER_REGS, CM_PER_UART1_CLKCTRL,CM_PER_L4LS_CLKSTCTRL,
CM_PER_L4LS_CLKSTCTRL_CLKACTIVITY_UART_GFCLK) ;
break;
It seems that PRCMModuleEnable() in am335x_prcm.c and am437x_prcm.c are quite different. How to insert this instructions in AM437x case???
3.) Any way i decide to move and make all steps except modification PRCMModuleEnable and change STDIO print instance to UART2 where is on VAR-AM43 rs-232 port.
Recompile PDK, run example in in CCS... No output at all.
4.)Then I try blink example with my portmux. Example and manual write on GPIO4_26 (LED3 on board) work. Write on GPIO4_8 (LED2 on board) doesn't make any output (values are changing in registers - "CCS registers view") .
GPIO_evmAM437x_board.c modification:
#define GPIO_USER0_LED_PIN_NUM (0x08)
#define GPIO_USER0_LED_PORT_NUM (0x04)
#define GPIO_USER1_LED_PIN_NUM (0x1A)
#define GPIO_USER1_LED_PORT_NUM (0x04)
/* GPIO Driver board specific pin configuration structure */
GPIO_PinConfig gpioPinConfigs[] = {
/* Input pin with interrupt enabled */
GPIO_DEVICE_CONFIG(( GPIO_USER1_LED_PORT_NUM + 1 ), GPIO_USER1_LED_PIN_NUM) |
GPIO_CFG_IN_INT_RISING | GPIO_CFG_INPUT,
/* Output pin */
GPIO_DEVICE_CONFIG( (GPIO_USER1_LED_PORT_NUM + 1), GPIO_USER1_LED_PIN_NUM) |
GPIO_CFG_OUTPUT,
/* Output pin */
GPIO_DEVICE_CONFIG( (GPIO_USER0_LED_PORT_NUM + 1), GPIO_USER0_LED_PIN_NUM) |
GPIO_CFG_OUTPUT
};
/* GPIO Driver call back functions */
GPIO_CallbackFxn gpioCallbackFunctions[] = {
NULL,
NULL,
NULL
};
main_led_blink modification:
void AppGpioCallbackFxn(void)
{
/* Toggle LED1 */
GPIO_toggle(USER_LED1);
GPIO_toggle(2);
AppDelay(DELAY_VALUE);
gpio_intr_triggered = 1;
}
I am lost!
Can you provide me checklist or detailed instructions for poting AM437x soc? Or any other directions?
Looking forward to help me...
Best Regards,
Marko