Data abort when starting DFU on SAMA5D2
Hi,
I am currently using an ATSAMA5D27-WLSOM1-EK1. This boards embeds an ATSAMA5D27-WLSOM1, which in turns holds an ATSAMA5D27 and a 8MB QSPI flash. I have been wanting to program u-boot in the QSPI flash thanks to DFU, since the board is able to boot from QSPI and is supported in uboot. To do so, I have executed the following steps:
- check out recent uboot version (2023.07.02, but issed described below is observed on master too)
- load sama5d27_wlsom1_ek_qspiflash_defconfig
- tune the configuration to enable DFU:
- CONFIG_CMD_DFU=y
- CONFIG_DFU_SF=y
- CONFIG_USB_GADGET_DOWNLOAD=y
- build uboot, upload and run it onto external ram thanks to snagrecover ([1]).
- running "bdinfo" shows that board is properly defined/recognized
- "sf probe" properly detects the qspi flash chip
- in u-boot console, configure dfu:
- setenv dfu_alt_info uboot raw 0 0x80000
- start DFU:
- dfu 0 sf 2:0
Unfortunately, this step systematically and immediately leads to a data abort with the following log:
=> dfu 0 sf 2:0
data abort
pc : [<2fda9ee0>] lr : [<2fd8dc08>]
reloc pc : [<26f3fee0>]lr : [<26f23c08>]
sp : 2f963fe8 ip : 2f9829cc fp : 00000000
r10: 2fde1cd9 r9 : 2f969e80 r8 : 2fdfc304
r7 : 00000000 r6 : 00000000 r5 : 2fdf3034 r4 : 2f982948
r3 : 0a299cfc r2 : ffffffec r1 : 00000000 r0 : 00000000
Flags: nzCv IRQs off FIQs off Mode SVC_32
Code: e5843058 e5950004 e3a01000 e5903008 (e5933008)
Resetting CPU ...
resetting ...
System reset not supported on this platform
### ERROR ### Please RESET the board ###
A quick translation with addr2line shows that the data abort occurs in include/linux/usb/gagdet.h, in usb_ep_alloc_request, likely because of ep being NULL, which seems confirmed by adding some custom logs in both usb_ep_alloc_request and its caller (composite_bind). Before digging further, does anyone have successfully used DFU on SAMA5D2 boards (and if so, am I missing something in the configuration) ? Or does this data abort show that some support is still missing to make it work for SAMA5D2 ?
Kind regards,
Alexis
[1] https://github.com/bootlin/snagboot
Signature · 3 lines
Alexis Lothoré, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Hi Alexis,
Quoted 40 lines · Alexis Lothoré
Hi,
I am currently using an ATSAMA5D27-WLSOM1-EK1. This boards embeds an ATSAMA5D27-WLSOM1, which in turns holds an ATSAMA5D27 and a 8MB QSPI flash. I have been wanting to program u-boot in the QSPI flash thanks to DFU, since the board is able to boot from QSPI and is supported in uboot. To do so, I have executed the following steps:
- check out recent uboot version (2023.07.02, but issed described below is observed on master too)
- loadsama5d27_wlsom1_ek_qspiflash_defconfig
- tune the configuration to enable DFU:
-CONFIG_CMD_DFU=y
-CONFIG_DFU_SF=y
-CONFIG_USB_GADGET_DOWNLOAD=y
- build uboot, upload and run it onto external ram thanks to snagrecover ([1]).
- running "bdinfo" shows that board is properly defined/recognized
- "sf probe" properly detects the qspi flash chip
- in u-boot console, configure dfu:
- setenvdfu_alt_infouboot raw 00x80000
- start DFU:
- dfu 0 sf 2:0Unfortunately, this step systematically and immediately leads to a data abort with the following log:
=> dfu 0 sf 2:0
data abortpc : [<2fda9ee0>] lr : [<2fd8dc08>]reloc pc : [<26f3fee0>]lr : [<
26f23c08>]
sp :2f963fe8ip :2f9829ccfp : 00000000
r10:2fde1cd9r9 :2f969e80r8 :2fdfc304
r7 : 00000000 r6 : 00000000 r5 :2fdf3034r4 :2f982948
r3 :0a299cfcr2 : ffffffec r1 : 00000000 r0 : 00000000
Flags: nzCv IRQs off FIQs off ModeSVC_32Code: e5843058 e5950004 e3a01000 e5903008 (e5933008)Resetting CPU ...
resetting ...
System reset not supported on this platform
### ERROR ### Please RESET the board ###
Quoted 7 lines
A quick translation with addr2line shows that the data abort occurs in
include/linux/usb/gagdet.h, inusb_ep_alloc_request, likely because of ep being NULL, which seems confirmed by adding some custom logs in bothusb_ep_alloc_requestand its caller (composite_bind). Before digging further, does anyone have successfully used DFU on SAMA5D2 boards (and if so, am I missing something in the configuration) ? Or does this data abort show that some support is still missing to make it work for SAMA5D2 ?
I believe this is related to the gadget more than DFU itself. Zixun LI (in CC) has attempted gadget on this platform at some point.
Mihai (also in CC) has did some tests with USB on this platform as well. Cristian has more knowledge of the USB implementation on sama5d2.
Eugen
Quoted 5 lines
Kind regards,
Alexis
Hi Alexis,
I've tried to USB gardet under u-boot without success (linux is ok).
I've contacted Microchip support (No.01275010) and from them:
"we confirmed with the internal team that USB is not fully functional with u-boot so for any query related to working of USB in u-boot we request you to create a NASCAR."
Regards,
Zixun
Quoted 75 lines · Eugen Hristev
Hi Alexis,
Quoted 3 lines · Alexis Lothoré
Hi,
I am currently using an ATSAMA5D27-WLSOM1-EK1. This boards embeds an ATSAMA5D27-WLSOM1, which in turns holds an ATSAMA5D27 and a 8MB QSPIflash. I
Quoted 1 line
have been wanting to program u-boot in the QSPI flash thanks to DFU,
since the
Quoted 1 line
board is able to boot from QSPI and is supported in uboot. To do so, I
have
Quoted 2 lines
executed the following steps:
- check out recent uboot version (2023.07.02, but issed described belowis
Quoted 7 lines
observed on master too)
- loadsama5d27_wlsom1_ek_qspiflash_defconfig
- tune the configuration to enable DFU:
-CONFIG_CMD_DFU=y
-CONFIG_DFU_SF=y
-CONFIG_USB_GADGET_DOWNLOAD=y
- build uboot, upload and run it onto external ram thanks to snagrecover([1]).
Quoted 8 lines
- running "bdinfo" shows that board is properly defined/recognized
- "sf probe" properly detects the qspi flash chip
- in u-boot console, configure dfu:
- setenvdfu_alt_infouboot raw 00x80000
- start DFU:
- dfu 0 sf 2:0Unfortunately, this step systematically and immediately leads to a data
abort
Quoted 12 lines
with the following log:
=> dfu 0 sf 2:0
data abortpc : [<2fda9ee0>] lr : [<2fd8dc08>]reloc pc : [<26f3fee0>]lr : [<
26f23c08>]
sp :2f963fe8ip :2f9829ccfp : 00000000
r10:2fde1cd9r9 :2f969e80r8 :2fdfc304
r7 : 00000000 r6 : 00000000 r5 :2fdf3034r4 :2f982948
r3 :0a299cfcr2 : ffffffec r1 : 00000000 r0 : 00000000
Flags: nzCv IRQs off FIQs off ModeSVC_32Code: e5843058 e5950004 e3a01000 e5903008 (e5933008)Quoted 8 lines
Resetting CPU ...
resetting ...
System reset not supported on this platform
### ERROR ### Please RESET the board ###A quick translation with addr2line shows that the data abort occurs in
include/linux/usb/gagdet.h, inusb_ep_alloc_request, likely because ofep being
Quoted 2 lines
NULL, which seems confirmed by adding some custom logs in both
usb_ep_alloc_requestand its caller (composite_bind). Before diggingfurther,
Quoted 2 lines
does anyone have successfully used DFU on SAMA5D2 boards (and if so, am I missing something in the configuration) ? Or does this data abort show
that some
Quoted 1 line
support is still missing to make it work for SAMA5D2 ?
I believe this is related to the gadget more than DFU itself. Zixun LI (in CC) has attempted gadget on this platform at some point.
Mihai (also in CC) has did some tests with USB on this platform as well. Cristian has more knowledge of the USB implementation on sama5d2.
Eugen
Quoted 5 lines
Kind regards,
Alexis
Hello Zixun, Eugen,
Quoted 8 lines · admin LI
Hi Alexis,
I've tried to USB gardet under u-boot without success (linux is ok).
I've contacted Microchip support (No.01275010) and from them:
"we confirmed with the internal team that USB is not fully functional with u-boot so for any query related to working of USB in u-boot we request you to create a NASCAR."
Thanks for the feedback and the status confirmation. I fell back with sam-ba for the moment
Kind regards,
Quoted 75 lines
Regards,
ZixunOn Wed, Aug 2, 2023 at 9:11 AM Eugen Hristev <[email protected] <mailto:[email protected]>> wrote:
Hi Alexis,
On 8/1/23 10:09, Alexis Lothoré wrote:
> Hi,
> I am currently using an ATSAMA5D27-WLSOM1-EK1. This boards embeds an > ATSAMA5D27-WLSOM1, which in turns holds an ATSAMA5D27 and a 8MB QSPI flash. I > have been wanting to program u-boot in the QSPI flash thanks to DFU, since the > board is able to boot from QSPI and is supported in uboot. To do so, I have > executed the following steps:
> - check out recent uboot version (2023.07.02, but issed described below is > observed on master too)
> - loadsama5d27_wlsom1_ek_qspiflash_defconfig
> - tune the configuration to enable DFU:
> -CONFIG_CMD_DFU=y
> -CONFIG_DFU_SF=y
> -CONFIG_USB_GADGET_DOWNLOAD=y
> - build uboot, upload and run it onto external ram thanks to snagrecover ([1]).
> - running "bdinfo" shows that board is properly defined/recognized > - "sf probe" properly detects the qspi flash chip
> - in u-boot console, configure dfu:
> - setenvdfu_alt_infouboot raw 00x80000
> - start DFU:
> - dfu 0 sf 2:0
>
> Unfortunately, this step systematically and immediately leads to a data abort > with the following log:
>
> => dfu 0 sf 2:0
> data abort
> pc : [<2fda9ee0>] lr : [<2fd8dc08>]
> reloc pc : [<26f3fee0>]lr : [<26f23c08>]
> sp : 2f963fe8 ip : 2f9829cc fp : 00000000
> r10: 2fde1cd9 r9 : 2f969e80 r8 :2fdfc304
> r7 : 00000000 r6 : 00000000 r5 : 2fdf3034 r4 :2f982948
> r3 : 0a299cfc r2 : ffffffec r1 : 00000000 r0 : 00000000
> Flags: nzCv IRQs off FIQs off ModeSVC_32
> Code:e5843058e5950004e3a01000e5903008(e5933008)
> Resetting CPU ...
>
> resetting ...
> System reset not supported on this platform
> ### ERROR ### Please RESET the board ###
>
> A quick translation with addr2line shows that the data abort occurs in >include/linux/usb/gagdet.h, inusb_ep_alloc_request, likely because of ep being
> NULL, which seems confirmed by adding some custom logs in both
>usb_ep_alloc_requestand its caller (composite_bind). Before digging further, > does anyone have successfully used DFU on SAMA5D2 boards (and if so, am I > missing something in the configuration) ? Or does this data abort show that some
> support is still missing to make it work for SAMA5D2 ?I believe this is related to the gadget more than DFU itself. Zixun LI (in CC) has attempted gadget on this platform at some point.
Mihai (also in CC) has did some tests with USB on this platform as well. Cristian has more knowledge of the USB implementation on sama5d2.
Eugen
>
> Kind regards,
> Alexis
>
> [1] https://github.com/bootlin/snagboot <https://github.com/bootlin/snagboot>
Signature · 3 lines
Alexis Lothoré, Bootlin Embedded Linux and Kernel engineering https://bootlin.com