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

i.MX RT10xx operator '*' has no right operand #438

Closed
MulattoKid opened this issue Apr 19, 2024 · 3 comments
Closed

i.MX RT10xx operator '*' has no right operand #438

MulattoKid opened this issue Apr 19, 2024 · 3 comments
Assignees

Comments

@MulattoKid
Copy link

MulattoKid commented Apr 19, 2024

When compiling for i.MX RT10xx I get the following error

core/devices/MIMXRT1042/MIMXRT1042.h:32067:65: error: operator '*' has no right operand
32067 | #define LPUART1                                  ((LPUART_Type *)LPUART1_BASE)

I've not hit this problem before, as we've been running with a slightly custom wolfBoot version internally.

A solution would be to compare the actual base address as an integer instead of a pointer, i.e. using LPUART1_BASE instead of LPUART1.

@dgarske
Copy link
Contributor

dgarske commented Apr 19, 2024

@bigbrett is going to review this.

Does this patch resolve the error? I can't tell what the specific wolfBoot error is, but I suspect it's this macro check.

diff --git a/hal/imx_rt.c b/hal/imx_rt.c
index 3c6e7398..7dd07076 100644
--- a/hal/imx_rt.c
+++ b/hal/imx_rt.c
@@ -715,7 +715,7 @@ void uart_init(void)
     lpuart_config_t config;
     uint32_t uartClkSrcFreq = 20000000U; /* 20 MHz */
 
-#if UART_BASEADDR == LPUART1
+#if (uintptr_t)UART_BASEADDR == (uintptr_t)LPUART1
     /* Configure the UART IO pins for LPUART1
      * Tested with RT1040, RT1050, RT1062 and RT1064
      */

Thanks,
David Garske, wolfSSL

@MulattoKid
Copy link
Author

MulattoKid commented Apr 19, 2024

Yes, it's UART_BASEADDR == LPUART1 that caused the issue. I handled it a bit differently in my PR, but your patch should work as well :)

@dgarske
Copy link
Contributor

dgarske commented Apr 19, 2024

Fixed with PR #439.

@dgarske dgarske closed this as completed Apr 19, 2024
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

No branches or pull requests

4 participants