public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] dfu_get_buf: Could not memalign 0x2000000 bytes
@ 2015-02-27 15:20 Fabio Estevam
  2015-02-27 15:35 ` Przemyslaw Marczak
  0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2015-02-27 15:20 UTC (permalink / raw)
  To: u-boot

Hi,

I am trying to run DFU in order to flash u-boot.imx into the SD card
on a mx6qsabresd.

The changes in config file are:

--- a/include/configs/mx6sabre_common.h
+++ b/include/configs/mx6sabre_common.h
@@ -295,4 +295,10 @@
 #define CONFIG_G_DNL_PRODUCT_NUM       0xa4a5
 #define CONFIG_G_DNL_MANUFACTURER      "FSL"

+#define CONFIG_CMD_DFU
+#define CONFIG_DFU_FUNCTION
+#define CONFIG_DFU_MMC
+#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
+#define DFU_DEFAULT_POLL_TIMEOUT 300
+
 #endif

=> mmc dev 1

=> setenv dfu_alt_info 'boot raw 0x2 0x400'
=> save

=> dfu 0 mmc 1

Then on the host PC:

$ sudo dfu-util -D u-boot.imx -a boot
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util at lists.gnumonks.org

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 0525:a4a5
Run-time device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 4096
Copying data from PC to DFU device
Download    [                         ]   0%            0 bytes failed!
state(10) = dfuERROR, status(14) = Something went wrong, but the
device does not know what it was

and the following error is seen in U-boot:

dfu_get_buf: Could not memalign 0x2000000 bytes

Does anyone have any suggestions about this?

Thanks,

Fabio Estevam

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] dfu_get_buf: Could not memalign 0x2000000 bytes
  2015-02-27 15:20 [U-Boot] dfu_get_buf: Could not memalign 0x2000000 bytes Fabio Estevam
@ 2015-02-27 15:35 ` Przemyslaw Marczak
  2015-02-27 15:43   ` Fabio Estevam
  0 siblings, 1 reply; 4+ messages in thread
From: Przemyslaw Marczak @ 2015-02-27 15:35 UTC (permalink / raw)
  To: u-boot

Hello Fabio,

On 02/27/2015 04:20 PM, Fabio Estevam wrote:
> Hi,
>
> I am trying to run DFU in order to flash u-boot.imx into the SD card
> on a mx6qsabresd.
>
> The changes in config file are:
>
> --- a/include/configs/mx6sabre_common.h
> +++ b/include/configs/mx6sabre_common.h
> @@ -295,4 +295,10 @@
>   #define CONFIG_G_DNL_PRODUCT_NUM       0xa4a5
>   #define CONFIG_G_DNL_MANUFACTURER      "FSL"
>
> +#define CONFIG_CMD_DFU
> +#define CONFIG_DFU_FUNCTION
> +#define CONFIG_DFU_MMC
> +#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
> +#define DFU_DEFAULT_POLL_TIMEOUT 300
> +
>   #endif
>
> => mmc dev 1
>
> => setenv dfu_alt_info 'boot raw 0x2 0x400'
> => save
>
> => dfu 0 mmc 1
>
> Then on the host PC:
>
> $ sudo dfu-util -D u-boot.imx -a boot
> dfu-util 0.8
>
> Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
> Copyright 2010-2014 Tormod Volden and Stefan Schmidt
> This program is Free Software and has ABSOLUTELY NO WARRANTY
> Please report bugs to dfu-util at lists.gnumonks.org
>
> dfu-util: Invalid DFU suffix signature
> dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
> Opening DFU capable USB device...
> ID 0525:a4a5
> Run-time device DFU version 0110
> Claiming USB DFU Interface...
> Setting Alternate Setting #0 ...
> Determining device status: state = dfuIDLE, status = 0
> dfuIDLE, continuing
> DFU mode device DFU version 0110
> Device returned transfer size 4096
> Copying data from PC to DFU device
> Download    [                         ]   0%            0 bytes failed!
> state(10) = dfuERROR, status(14) = Something went wrong, but the
> device does not know what it was
>
> and the following error is seen in U-boot:
>
> dfu_get_buf: Could not memalign 0x2000000 bytes
>
> Does anyone have any suggestions about this?
>
> Thanks,
>
> Fabio Estevam
>

Yes, please update line 33 in your config file, at least with this

  #define CONFIG_SYS_MALLOC_LEN           (10 * SZ_1M) + 
CONFIG_SYS_DFU_DATA_BUF_SIZE

You don't have enough malloc memory reserved.

Best regards,
-- 
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] dfu_get_buf: Could not memalign 0x2000000 bytes
  2015-02-27 15:35 ` Przemyslaw Marczak
@ 2015-02-27 15:43   ` Fabio Estevam
  2015-02-27 15:45     ` Przemyslaw Marczak
  0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2015-02-27 15:43 UTC (permalink / raw)
  To: u-boot

Hi Przemyslaw,

On Fri, Feb 27, 2015 at 12:35 PM, Przemyslaw Marczak
<p.marczak@samsung.com> wrote:

> Yes, please update line 33 in your config file, at least with this
>
>  #define CONFIG_SYS_MALLOC_LEN           (10 * SZ_1M) +
> CONFIG_SYS_DFU_DATA_BUF_SIZE
>
> You don't have enough malloc memory reserved.

This fixes the problem :-)

Thanks a lot for your help!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] dfu_get_buf: Could not memalign 0x2000000 bytes
  2015-02-27 15:43   ` Fabio Estevam
@ 2015-02-27 15:45     ` Przemyslaw Marczak
  0 siblings, 0 replies; 4+ messages in thread
From: Przemyslaw Marczak @ 2015-02-27 15:45 UTC (permalink / raw)
  To: u-boot

Hello Fabio,

On 02/27/2015 04:43 PM, Fabio Estevam wrote:
> Hi Przemyslaw,
>
> On Fri, Feb 27, 2015 at 12:35 PM, Przemyslaw Marczak
> <p.marczak@samsung.com> wrote:
>
>> Yes, please update line 33 in your config file, at least with this
>>
>>   #define CONFIG_SYS_MALLOC_LEN           (10 * SZ_1M) +
>> CONFIG_SYS_DFU_DATA_BUF_SIZE
>>
>> You don't have enough malloc memory reserved.
>
> This fixes the problem :-)
>
> Thanks a lot for your help!
>

No problem. You uncover one more thing, which should be done before 
change the dfu mmc static buffer with memalign, which is increase the 
malloc memory, for configs with dfu.

Best regards,
-- 
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-27 15:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-27 15:20 [U-Boot] dfu_get_buf: Could not memalign 0x2000000 bytes Fabio Estevam
2015-02-27 15:35 ` Przemyslaw Marczak
2015-02-27 15:43   ` Fabio Estevam
2015-02-27 15:45     ` Przemyslaw Marczak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox