EmbDev.net

Forum: ARM programming with GCC/GNU tools bootloader via USB


von Roman M. (romez777)


Rate this post
useful
not useful
Hello,

I'm working on the bootloader, which is supposed to load image via USB.
It is AT91SAM7S256-based product. I've read Atmel's documentation and
reviewed the accompanied code.

So to test firmware I need to impement a simple user application (i.e.
Win32) to upload the image. I don't quite understand how to split the
image in to equal chunks, which will be sent over USB.

As I understood Atmel's documentation, only whole pages are burnt on
flash, i.e. I need to prepare set of chunks with size of page, correct?
But image size doesn't necessary be multiple, so there would be some
little piece remained.

Are there any ideas about that?

Thanks.

von Jonathan D. (dumarjo)


Rate this post
useful
not useful
Roman Mashak wrote:
> Hello,
>
> I'm working on the bootloader, which is supposed to load image via USB.
> It is AT91SAM7S256-based product. I've read Atmel's documentation and
> reviewed the accompanied code.
>
> So to test firmware I need to impement a simple user application (i.e.
> Win32) to upload the image.

>I don't quite understand how to split the
> image in to equal chunks, which will be sent over USB.
What is the driver you used on the USB ? CDC ?

You read a 256Byts and split them to the maximum size of the EP. I think
is 64 on SAM7 parts.

>
> As I understood Atmel's documentation, only whole pages are burnt on
> flash, i.e.
I need to prepare set of chunks with size of page, correct?
Yeah your right.

> But image size doesn't necessary be multiple, so there would be some
> little piece remained.

The little piece remained will be filled with 0x00 or 0xff or anything
else. It doesn't matter.

>
> Are there any ideas about that?
>
> Thanks.

Hope this help

Jonathan

von Roman M. (romez777)


Rate this post
useful
not useful
Jonathan Dumaresq wrote:

Thank you for your feedback.
Sorry for such a late reply. Things kept me busy.

> What is the driver you used on the USB ? CDC ?

Correct. I use CDC example form Atmel.

>
> You read a 256Byts and split them to the maximum size of the EP. I think
> is 64 on SAM7 parts.

I don't quite understand here. Why do I read 256bytes and then divide to
the page size? What is EP, to be precise?

>
>>
>> As I understood Atmel's documentation, only whole pages are burnt on
>> flash, i.e.
> I need to prepare set of chunks with size of page, correct?
> Yeah your right.

Is it necessary to prepend every chunk with some header? I mean what is
the way to specify the first or last chunk in the stream?

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.