Closed
Description
Seeing a number of sanitycheck failures due the following warning when building with the newer gcc in sdk 0.10.0-beta:
/home/galak/git/zephyr/ext/hal/st/stm32cube/stm32f4xx/drivers/src/stm32f4xx_ll_usb.c: In function 'USB_WritePacket':
/home/galak/git/zephyr/ext/hal/st/stm32cube/stm32f4xx/drivers/src/stm32f4xx_ll_usb.c:886:7: error: 'packed' attribute ignored for type 'uint32_t *' {aka 'unsigned int *'} [-Werror=attributes]
USBx_DFIFO(ch_ep_num) = *((__packed uint32_t *)src);
^~~~~~~~~~
/home/galak/git/zephyr/ext/hal/st/stm32cube/stm32f4xx/drivers/src/stm32f4xx_ll_usb.c: In function 'USB_ReadPacket':
/home/galak/git/zephyr/ext/hal/st/stm32cube/stm32f4xx/drivers/src/stm32f4xx_ll_usb.c:912:5: error: 'packed' attribute ignored for type 'uint32_t *' {aka 'unsigned int *'} [-Werror=attributes]
*(__packed uint32_t *)dest = USBx_DFIFO(0U);
^
cc1: all warnings being treated as errors
Reproduce:
./scripts/sanitycheck -T samples/subsys/usb/cdc_acm -l
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
galak commentedon Feb 10, 2019
Not sure what the proper workaround for this. Not clear to me why the cast to (__packed uint32_t *) is even there.
In previous similar issue, I fixed this with UNALIGNED_GET() see commit 93d0f8c.
Whatever fix will probably need to be applied to all these cases:
erwango commentedon Feb 11, 2019
What about using CMSIS defines ?
Downloading sdk_ng, so I haven't been able to test.
Though, since available in cmsis pack, these should be easier to propagate in Cube releases
galak commentedon Feb 11, 2019
This makes the warnings go away for me, please look to see its correct and I think you can make the change for the other driver instances:
erwango commentedon Feb 11, 2019
Tested ok on nucleo_f429zi.
Will submit internal ST issues and make fixes in cube packages
ext/hal: stm32l4xx: Use of (__packed uint32_t *) produces warnings
8 remaining items