MQX, AR4100 and bool...

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MQX, AR4100 and bool...

674 Views
yb
Contributor IV

Hi,

CW10.6 / MQX 4.2 / K60d100m

I have a general question, since I have a lot of unresolved crashes with UART in itty.

From Re: Bug Report: In MQX 4.1 change of size of bool can cause stack corruption  :

In MQX 4.0.x a boolean type was an alias of an unsigned long  (32bits).

In MQX 4.1.x a bool is a C99 standard type, and is guaranteed to be 8 bits on all platforms.

With Atheros AR4100, we MUST use boolean as 32 bits : a_types.h :

/* NOTE: A_BOOL is a type that is used in various WMI commands and events.

* as such it is a type that is shared between the wifi chipset and the host.

* It is required for that reason that A_BOOL be treated as a 32-bit/4-byte type.

From the same post, bool in 32 bits can provides stack problems even if I can read (from MQX 4.2 release) :

MQX-4406 Change of bool type size and casting return types can cause stack corruption. IOCTL bool param handling in _io_cdc_serial_ioctl() corrected. IOCTL bool param handling in NANDFLASH_IOCTL_WRITE_PROTECTED ioctl + minor changes in esai example have been made.

So, how must be my bool type in stdbool.h to continue using AR4100 ??? unsigned char ? uint32 ? other ?


Yvan

0 Kudos
2 Replies

419 Views
soledad
NXP Employee
NXP Employee

Hello Yvan,

According with the Getting Started with Freescale MQX™ RTOS document:

Starting with the MQX RTOS version 4.1.0, the standard C99 integer and boolean types (from stdlib.h and stdbool.h) are

used instead of the proprietary MQX RTOS types. When porting the application to the MQX RTOS version 4.1.0,

compilation issues could occur. The psptypes_legacy.h header file is available and contains the definition of the MQX RTOS

legacy types. This file can be included in the MQX RTOS application to overcome most of the compilation problems caused

by the change of types. To avoid potential problems, adopt the C99 types in your application.


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

419 Views
yb
Contributor IV

Hi Soledad,

I can NOT use C99 in my app because your (FREESCALE / Atheros) code doesn't support it for boolean type. I had a look at the AR4100 driver, there are too more changes and tests to change the boolean type...

Yvan

0 Kudos