Skip to content

Conversation

@spencerjcoward
Copy link

Add support for the TI AM243x LaunchPad board. This board is based on the work done for the am243x_evm board, with modifications to the device tree and board configuration files to suit the LaunchPad's hardware.

@github-actions
Copy link

Hello @spencerjcoward, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@vaishnavachath vaishnavachath self-assigned this Jun 22, 2025
@vaishnavachath vaishnavachath requested a review from glneo June 22, 2025 15:58
@vaishnavachath
Copy link
Member

@natto1784 please take a look.

@natto1784
Copy link
Contributor

Pinging @m-braunschweig, as they have also worked on adding extensive AM243LP support in their fork

@nordicjm nordicjm requested a review from kartben June 23, 2025 06:57
@vaishnavachath vaishnavachath self-requested a review June 23, 2025 08:27
Copy link
Contributor

@m-braunschweig m-braunschweig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems mosty good except some old EVM references. I have problems running the blinky sample with additionally CONFIG_LOG and CONFIG_ASSERT enabled. Since the Data Fault Address Register held an address in the external RAM memory space I assume that something like RSC tried to log data and this resulted in a fault.

Aditionally I think it might be better to name the SoC before the fact that it's a launchpad so it's consistent with the 243evm.

Also as Natto mentioned I also worked on adding Zephyr support for this board (that's also intended to be added upstream). However I didn't take a look at the M4 processor core and ADC/I2C so I think it would be better to continue with this PR

Comment on lines +23 to +31
The board physically contains:

- Memory.

- 256KB of SRAM

- Debug

- XDS110 based JTAG
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not right for the AM243x LaunchPad. It has instead

  • 512 Mb of Infineon NOR Flash connected via QuadSPI
  • DIP switches to change the boot mode
  • Buttons to reset parts of the SoC in different ways
  • A push button connected to a GPIO pin
  • Multiple LEDs (some for power indication and some connected to GPIO pins)
  • A XDS110 debug probe (JTAG emulation)

Comment on lines +43 to +50
DDR RAM
-------

The board has 2GB of DDR RAM available. This board configuration allocates:

- 4KB Resource Table at 0xa4100000 for M4
- 4KB Resource Table at 0xa0100000 for R5F0_0
- 8MB Shared Memory at 0xa5000000 for inter-processor communication
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no external RAM connected ot the AM243x Launchpad; the 0xaXXXXXXX memory area is where external RAM would be accessible

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see that i missed these non existent ddr locations still being referenced in the dts, how would you like me to resolve the current need for RSC_TABLE? SOC_SERIES_AM6X_M4 selects this in Kconfig, should i reserve a piece of sram to contain these?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also i did do a test where i remove all the nodes referencing the external ddr (ipc, shm, rsc table) and put OPENAMP_RSC_TABLE=n in the defconfig for the m4 and then i am able to turn on CONFIG_LOG and CONFIG_ASSERT.

Would it be best to leave the RSC table and IPC for another PR and just disable that feature for now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for RSC / ipc it would be good to put the memory regions into one of the unused SRAM areas (based on the default layout of the TI MCU+ SDK). If you want to do it in this PR on in another PR is up to you.

also i did do a test where i remove all the nodes referencing the external ddr (ipc, shm, rsc table) and put OPENAMP_RSC_TABLE=n in the defconfig for the m4 and then i am able to turn on CONFIG_LOG and CONFIG_ASSERT.

I will create a separate comment for this since there are multiple problems (also in already existing code). Please also note that I'm focussing on using Zephyr on the Cortex-R5 and no the M4

.. list-table:: UART Boot Mode
:header-rows: 1

* - SW2 [1:7]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the LaunchPad there is only one switch row named SW4 fot selecting the boot mode

.. list-table:: OSPI Boot Mode
:header-rows: 1

* - SW2 [1:7]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same SW4 comment

Comment on lines +44 to +54
rsc_table: memory@a4100000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0xa4100000 DT_SIZE_K(4)>;
zephyr,memory-region = "RSC_TABLE";
};

ipc_shm0: memory@a5000000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0xa5000000 DT_SIZE_M(8)>;
zephyr,memory-region = "IPC_SHM";
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This points to non-existant external DRAM

adc0 = &adc0;
};

leds: leds {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are more LEDs on the board but at least one can't be controlled due to #81100.
It might be a good idea to mention that at least as comment

Comment on lines +38 to +50
rsc_table: memory@a0100000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0xa0100000 DT_SIZE_K(4)>;
zephyr,memory-region = "RSC_TABLE";
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_RAM) )>;
};

ipc_shm0: memory@a5000000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0xa5000000 DT_SIZE_M(8)>;
zephyr,memory-region = "IPC_SHM";
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_IO) )>;
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

External RAM doesn't exist

CONFIG_UART_CONSOLE=y

# Enable MPU
CONFIG_ARM_MPU=y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally the MPU should be generally enabled for the AM2434 and not for every board that supports it manually. However the Kconfig needs some cleanup anyway IMO so I wouldn't do it in this PR

Add support for the TI AM243x LaunchPad board. This board is based on the
work done for the am243x_evm board, with modifications to the device tree
and board configuration files to suit the LaunchPad's hardware. With
reduced image size for board.

Signed-off-by: Spencer J. Coward <[email protected]>
Address comments from PR 91986, relating to the formatting of the
board.cmake file and the dtsi files for the lp_am243x board.

Signed-off-by: Spencer J. Coward <[email protected]>
@natto1784
Copy link
Contributor

An offtopic suggestion: Maybe we ought to put the C-file MPU configuration in boards/ directory instead of soc/. This would help avoid ifdefs as well as would allow a more flexible MPU configuration. Right now, for AM2434, it is a mix of DT configuration and C-file which does not sit right with me.

@m-braunschweig
Copy link
Contributor

I had a look at running this PR on the R5 core (board qualifier: lp_am243x/am2434/r5f0_0) with RSC / ipc removed from the devicetree and disabled in the Kconfig. There were multiple things I had to change to get Zephyr running with asserts and logging enabled:

  • NUM_IRQS is set to 512 and on startup the interrupt controller checks the configured number of interrupts against the reported number of interrupts from the interrupt controller (256) in an assert statement
  • The frequency in the Kconfig (SYS_CLOCK_HW_CYCLES_PER_SEC) is wrong so k_sleep will not wait the specified amount of time
  • For running Zephyr via the sbl_uart bootloader it's also necessary to change Kconfig options related to the romstart region so the exception vector lands in the ATCM. Additionally the MPU config needs one adjustment so the execution of the reset vector isn't forbidden. @natto1784 do you happen to know something related to how this exactly works on the EVM without problems? Does loading the code via the Code Composer Studio IDE do something special? I know that there is theoretically also a feature inside the AM2434 to relocate the exception vector but using it with Zephyr doesn't relocate enough bytes since the actual addresses itself are stored a few byte after the exception vector
  • When the ns16550 driver runs its initialization function it also tries to configure the interrupt since you enabled interrupts for UART. When the irq_config_func function pointer is called it seems like the flags got discarded for some reason which results in the Interrupt Controller driver trying to log an error (the flags not being a valid value) via UART before it is initialized

Also: These are mostly existing Kconfig problems that were already mentioned in the EVM PR but postponed, so the scope of the PR for initial AM2434 support didn't increase further. I don't personally know what the best way would be to go forward with this (on one hand the Kconfig things should be fixed and on the other hand the scope of this PR shouldn't be increased (too much)). If you are ok with it and want it I could create a commit that you can include into this PR via cherry-picking. However it would also be possible to clean up the Kconfig in a separate PR either before or after this is merged. I would like to hear comments from the other people in this PR what they think the best solution would be

@m-braunschweig
Copy link
Contributor

An offtopic suggestion: Maybe we ought to put the C-file MPU configuration in boards/ directory instead of soc/. This would help avoid ifdefs as well as would allow a more flexible MPU configuration. Right now, for AM2434, it is a mix of DT configuration and C-file which does not sit right with me.

I personally think the soc directory is alrady more appropiate since the memory layout is SoC specific and the #ifdef things mostly arise from the current differentiation between the K3 series SoCs (though we don't really have that (yet)). The only thing that could be considered board specific would be externally connected RAM, though the address for that also doesn't change based on the board.

The mix between MPU configuration inside the devicetree and an additional configuration file also seems a bit weird to me, however when I looked last time it seemed like most platforms preferred configuration inside the devicetree. The problem is that it seems like there are no general guidelines on what should be preferred. Though the ATTR_MPU_RAM things seem to be legacy?

@natto1784
Copy link
Contributor

Yes it is indeed legacy. The problem with using ATTR_MPU_RAM on SRAM is that there is no unprivileged read access to .text and .rodata which sit inside the SRAM, and while this is not a problem usually but this won't work when CONFIG_USERSPACE is enabled.

@sonarqubecloud
Copy link

@spencerjcoward spencerjcoward requested a review from nordicjm July 1, 2025 00:19

if(CONFIG_SOC_AM2434_M4)
board_runner_args(openocd "--no-init" "--no-halt" "--no-targets" "--gdb-client-port=3338")
board_runner_args(openocd "--no-init" "--no-halt" "--no-targets" "--gdb-client-port=3338")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no fixup commits, squash

Comment on lines +88 to +167
channel@0 {
reg = <0>;
ti,open-delay = <0>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <0>;
zephyr,resolution = <12>;
zephyr,oversampling = <4>;
};

channel@1 {
reg = <1>;
ti,open-delay = <0>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <0>;
zephyr,resolution = <12>;
zephyr,oversampling = <4>;
};

channel@2 {
reg = <2>;
ti,open-delay = <0>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <0>;
zephyr,resolution = <12>;
zephyr,oversampling = <4>;
};

channel@3 {
reg = <3>;
ti,open-delay = <0>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <0>;
zephyr,resolution = <12>;
zephyr,oversampling = <4>;
};

channel@4 {
reg = <4>;
ti,open-delay = <0>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <0>;
zephyr,resolution = <12>;
zephyr,oversampling = <4>;
};

channel@5 {
reg = <5>;
ti,open-delay = <0>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <0>;
zephyr,resolution = <12>;
zephyr,oversampling = <4>;
};

channel@6 {
reg = <6>;
ti,open-delay = <0>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <0>;
zephyr,resolution = <12>;
zephyr,oversampling = <4>;
};

channel@7 {
reg = <7>;
ti,open-delay = <0>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <0>;
zephyr,resolution = <12>;
zephyr,oversampling = <4>;
};
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should not be here, I made a PR to change that for am243x evm as well: #92170

gpio0_led1: test_led1_green {
pinmux = <K3_PINMUX(0x58, PIN_OUTPUT, MUX_MODE_7)>;
};
}; No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing newline

@github-actions
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Aug 31, 2025
@github-actions github-actions bot closed this Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants