Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for MIMXRT1042XJM5B #405

Merged
merged 2 commits into from
Feb 15, 2024

Conversation

MulattoKid
Copy link

@MulattoKid MulattoKid commented Feb 13, 2024

This PR adds support for MIMXRT1042XJM5B. I've tested this locally on the EVK and a custom PCB, and it works on both.

My approach was:

  • search for places where the 1052 was referenced and adding support for the 1042
  • run make and fix compilation warnings for both wolfBoot and the test application

I added local support for patching the test app's ELF file to add the signature to it. Doing so I could flash both wolfBoot and the test app through VSCode, and was able to get to both binaries main entrypoints.

I've not tested that this doesn't break any of the other RT targets.

@danielinux This is the support we discussed during our call. Hopefully this can help getting 1042 support included in wolfBoot.

Kind regards,
Daniel

@dgarske
Copy link
Contributor

dgarske commented Feb 13, 2024

See ZD 17479

@MulattoKid
Copy link
Author

One thing I forgot to mention was that in uart_init in hal/imx_rt.c I had to specifically configure the pins used for debug output like so:

CLOCK_EnableClock(kCLOCK_Iomuxc);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_12_LPUART1_TX, 0U);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_13_LPUART1_RX, 0U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_12_LPUART1_TX, 0x10B0U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_13_LPUART1_RX, 0x10B0U);

When not doing this, I didn't get any debug output from the bootloader. I did compile with

DEBUG_UART?=1
PRINTF_ENABLED?=1

in my .config. Not sure if I'm missing something?

@dgarske
Copy link
Contributor

dgarske commented Feb 15, 2024

Hi @MulattoKid ,

Thank you so much for this PR. Your contributor agreement has been accepted and placed on file.

We've assigned this PR to @bigbrett for review.

Thanks,
David Garske, wolfSSL

bigbrett
bigbrett previously approved these changes Feb 15, 2024
Copy link
Contributor

@bigbrett bigbrett left a comment

Choose a reason for hiding this comment

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

Code additions look great, and confirmed no regressions on this branch when building for the RT1052 and RT1054 targets. Note that, since I don't have hardware, I'm unable to test this on the RT 1042.

@bigbrett
Copy link
Contributor

One thing I forgot to mention was that in uart_init in hal/imx_rt.c I had to specifically configure the pins used for debug output like so:

CLOCK_EnableClock(kCLOCK_Iomuxc);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_12_LPUART1_TX, 0U);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_13_LPUART1_RX, 0U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_12_LPUART1_TX, 0x10B0U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_13_LPUART1_RX, 0x10B0U);

When not doing this, I didn't get any debug output from the bootloader. I did compile with

DEBUG_UART?=1
PRINTF_ENABLED?=1

in my .config. Not sure if I'm missing something?

@MulattoKid Not sure off the top of my head, I will look into this more. It doesn't appear that the hal layer does this pin mux initialization, which could be why printouts don't show up. Regardless, I don't want this to block your PR.

@dgarske dgarske assigned dgarske and wolfSSL-Bot and unassigned bigbrett Feb 15, 2024
Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

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

Thank you @MulattoKid

@dgarske dgarske merged commit 11017d8 into wolfSSL:master Feb 15, 2024
79 checks passed
@MulattoKid
Copy link
Author

Thanks for the quick responses :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants