AnsweredAssumed Answered

MQX, AR4100 and bool...

Question asked by Yvan BOURNE on Aug 18, 2015
Latest reply on Aug 25, 2015 by Yvan BOURNE

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

Outcomes