bootloader via USB

OP #1173653
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.
#1173654
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
OP #1173655
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?

Reply

A question of your own? This thread is over 18 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.