SiliconLabs/wfx-fullMAC-driver

Little endian driver issue with STM32L4

FabianNiehaus89 opened this issue · 5 comments

For the controller STM32L4, configured as little endian system, I have to comment the follwoing line to reache propper functionality:

File: sl_wfx.c line 1721:
//network_rx_buffer->header.length = sl_wfx_htole16(network_rx_buffer->header.length);

After removing this line, driver works as espected.

Hi Fabian,

Thanks for your report.
It is strange. Is BIG_ENDIAN defined in your project?
https://github.com/SiliconLabs/wfx-fullMAC-driver/blob/master/wfx_fmac_driver/sl_wfx_constants.h#L146
In this definition above, in little endian, sl_wfx_htole16 is "identity" and commenting the line shouldn't be necessary.

Regards,
Julien

Hi Julien,

i found out that in endian.h both define exists:

#if __BSD_VISIBLE

#define	LITTLE_ENDIAN	_LITTLE_ENDIAN

#define	BIG_ENDIAN	_BIG_ENDIAN

#define	PDP_ENDIAN	_PDP_ENDIAN

#define	BYTE_ORDER	_BYTE_ORDER

#endif

so problem is solved but maybe there should be used a other define?

Agreed, we will make the define name explicit/specific in the next driver version.

Perfekt! Thank you.

Hi Fabian,

The issue has been addressed in the FMAC driver 3.3.0.

#ifdef SL_WFX_BIG_ENDIAN

Regards,
Julien