public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Re: redboot on STM32f4-discovery board
@ 2014-10-10 17:22 Oleg Uzenkov
  0 siblings, 0 replies; 6+ messages in thread
From: Oleg Uzenkov @ 2014-10-10 17:22 UTC (permalink / raw)
  To: John Dallaway; +Cc: eCos Discussion

Hi John,

I managed to get redboot running on the board (without external ram)
redboot has been built with (CYGOPT_REDBOOT_FIS == 0) and it is stable.

I even can do:
RedBoot> fconfig -i
Initialize non-volatile configuration - continue (y/n)? y
Run script at boot: false
Console baud rate: 115200
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0x08040000-0x08040fff: .
... Program from 0x20012000-0x20013000 to 0x08040000: .
RedBoot>


There is something strange in what I have noticed:

Output with (CYGBLD_REDBOOT_LOAD_INTO_FLASH == 0):

RAM: 0x20000000-0x2001f000 [0x20003a58-0x20010000 available]
       0x10000000-0x10010000 [0x10000000-0x10010000 available]
FLASH: 0x08000000-0x0807ffff, 4 x 0x4000 blocks, 1 x 0x10000 blocks, 3 x
0x20000 blocks
RedBoot>

(RedBoot is using 0x3a58 bytes of internal RAM.)

Output with (CYGBLD_REDBOOT_LOAD_INTO_FLASH == 1) (nothing else was
modified):

RAM: 0x20000000-0x2001f000 [0x20003a88-0x1fff0000 available]
       0x10000000-0x10010000 [0x10000000-0x10010000 available]
FLASH: 0x08000000-0x0807ffff, 4 x 0x4000 blocks, 1 x 0x10000 blocks, 3 x
0x20000 blocks
RedBoot>

Notice [0x20003a88-0x1fff0000 available]: range is invalid. Any ideas why?



How can I load a small .elf file (built for RAM startup) now and store
it in internal flash and execute? :-)

this is what happens when i do:

RedBoot> load -m x
C*** Abort! Attempt to load ELF data to address: 0x20000288 which is not
valid
xyzModem - CRC mode, 2(SOH)/0(STX)/0(CAN) packets, 3 retries
RedBoot>

address 0x20000288 is not valid probably because we have
[0x20003a58-0x20010000 available]
and 0x20000288 is occupied by redboot. What do I do?

Oleg



> Hi Oleg
>
> On 09/10/14 16:48, Oleg Uzenkov wrote:
>
>> I have tried to run redboot on a custom board (very similar to
>> STM32f4-discovery board, so let's say that we have discovery in question).
> [ snip ]
>
>> I just would like to get redboot working on a board without external RAM.
>>
>> These are my findings so far:
>>
>> 1. I built redboot for ROM startup (applied relevant adjustings from
>> stm3240g_eval's  redboot_rom.ecm)
>>
>> 2. flashed the board with redboot at 0x08000000
>>
>> 3.
>> when CYGOPT_REDBOOT_FIS == 0 redboot loads, but is very unstable, can
>> stop working any time... But, without Flash Image System I do not see
>> how to use redboot to load and store and run images.
>>
>> when CYGOPT_REDBOOT_FIS == 1  redboot hangs.  It happens when
>> do_flash_init() runs (problem in memcpy , probably illigal memory access)
>>
>> A question, can actually redboot work without external ram?
>>
>> If yes, how to fit it properly? (the board has stm32f407VE with 128+64
>> KB of internal ram, 512KB internal flash)
> Consider the output of RedBoot on STM3240G-EVAL (from your earlier message):
>
>> RedBoot(tm) bootstrap and debug environment [ROM]
>> ...
>> Platform: ST STM3240G-EVAL (Cortex-M4)
>> RAM: 0x64000000-0x64200000 [0x64005d30-0x641dd000 available]
>>       0x20000000-0x2001f000 [0x20000000-0x2001f000 available]
>>       0x10000000-0x10010000 [0x10000000-0x10010000 available]
>> FLASH: 0x08000000-0x080fffff, 4 x 0x4000 blocks, 1 x 0x10000 blocks, 7 x 0x20000 blocks
>> RedBoot>
> This shows that RedBoot is using 0x5d30 bytes of external RAM with FIS
> enabled. If you have ported RedBoot to your custom board correctly, I
> would expect it to report internal RAM usage similar, but not identical,
> to the following:
>
>> RAM: 0x20000000-0x2001f000 [0x20005d30-0x2001f000 available]
> Is that what you are observing?
>
> So RedBoot should fit it available RAM quite easily.
>
> I would concentrate on tracking down the reliability issue when RedBoot
> is configured without the FIS first. Once you have a stable RedBoot
> without the FIS, you can then try enabling the FIS.
>
> I hope this helps....
>
> John Dallaway
> eCos maintainer
> http://www.dallaway.org.uk/john
>




-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* [ECOS] Re: redboot on STM32f4-discovery board
  2014-10-09 15:48     ` [ECOS] " Oleg Uzenkov
@ 2014-10-09 18:44       ` John Dallaway
  0 siblings, 0 replies; 6+ messages in thread
From: John Dallaway @ 2014-10-09 18:44 UTC (permalink / raw)
  To: Oleg Uzenkov; +Cc: eCos Discussion

Hi Oleg

On 09/10/14 16:48, Oleg Uzenkov wrote:

> I have tried to run redboot on a custom board (very similar to
> STM32f4-discovery board, so let's say that we have discovery in question).

[ snip ]

> I just would like to get redboot working on a board without external RAM.
> 
> These are my findings so far:
> 
> 1. I built redboot for ROM startup (applied relevant adjustings from
> stm3240g_eval's  redboot_rom.ecm)
> 
> 2. flashed the board with redboot at 0x08000000
> 
> 3.
> when CYGOPT_REDBOOT_FIS == 0 redboot loads, but is very unstable, can
> stop working any time... But, without Flash Image System I do not see
> how to use redboot to load and store and run images.
> 
> when CYGOPT_REDBOOT_FIS == 1  redboot hangs.  It happens when
> do_flash_init() runs (problem in memcpy , probably illigal memory access)
> 
> A question, can actually redboot work without external ram?
> 
> If yes, how to fit it properly? (the board has stm32f407VE with 128+64
> KB of internal ram, 512KB internal flash)

Consider the output of RedBoot on STM3240G-EVAL (from your earlier message):

> RedBoot(tm) bootstrap and debug environment [ROM]
> ...
> Platform: ST STM3240G-EVAL (Cortex-M4)
> RAM: 0x64000000-0x64200000 [0x64005d30-0x641dd000 available]
>      0x20000000-0x2001f000 [0x20000000-0x2001f000 available]
>      0x10000000-0x10010000 [0x10000000-0x10010000 available]
> FLASH: 0x08000000-0x080fffff, 4 x 0x4000 blocks, 1 x 0x10000 blocks, 7 x 0x20000 blocks
> RedBoot> 

This shows that RedBoot is using 0x5d30 bytes of external RAM with FIS
enabled. If you have ported RedBoot to your custom board correctly, I
would expect it to report internal RAM usage similar, but not identical,
to the following:

> RAM: 0x20000000-0x2001f000 [0x20005d30-0x2001f000 available]

Is that what you are observing?

So RedBoot should fit it available RAM quite easily.

I would concentrate on tracking down the reliability issue when RedBoot
is configured without the FIS first. Once you have a stable RedBoot
without the FIS, you can then try enabling the FIS.

I hope this helps....

John Dallaway
eCos maintainer
http://www.dallaway.org.uk/john


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] Re: redboot on STM32f4-discovery board
  2014-10-05  8:32     ` Oleg Uzenkov
@ 2014-10-05  9:56       ` "Ilija Kocho [Илија Кочо]"
  0 siblings, 0 replies; 6+ messages in thread
From: "Ilija Kocho [Илија Кочо]" @ 2014-10-05  9:56 UTC (permalink / raw)
  To: Oleg Uzenkov; +Cc: John Dallaway, eCos Discussion

On 05.10.2014 10:32, Oleg Uzenkov wrote:
> Hello, John, Ilija,
>
> Thanks for your help!
>
> I will study in depth STM32x0G_EVAL and Kinetis platform HAL packages.
>
> My main goal is to port and use redboot on my own custom board which
> is similar to STM32f4-discovery board (stm32f407VE processor, no
> external ram, 512KB of internal flash, 128KiB  of ram). The custom
> board has got sdcard (with FAT32) though. Redboot should be
> responsible for loading a binary stored in sdcard.
>
> The general steps, it seems to me I need to take, are as follows:
>
> 1) add cdl items you mentioned in the previous mail into the board's
> HAL package ( + all what is needed to work with sdcard) -> build
> redboot.bin
> 2) load redboot.bin (built as "ROM" startup type)  into internal flash
> at 0x08000000
> 3) place app.bin file onto sdcard (image need to be built with "RAM"
> startup type)

You may consider creation of FLASH startup type.
Here http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001623 I started a
discussion on this subject, I hope this thread triggers us to a
conclusion :).

Ilija

> 4) on reset redboot mounts sdcard -> selects a binary and loads it
> into internal flash (at address not overlapping redboot)
> 5) need to copy app's code to ram for execution and run it (do not
> know how to, probably need startup code?)
>
> Please, could you correct me if I am wrong in the general understanding.
>
> I very much appreciate your help.
>
> Oleg
>
>> On 03.10.2014 13:40, John Dallaway wrote:
>>> Hi Oleg
>>>
>>> On 02/10/14 09:47, Oleg Uzenkov wrote:
>>>
>>>> I am working with eCos on STM32f4-discovery board.
>>>>
>>>> I would like to build a redboot loader that could choose and load
>>>> binaries (eCos+app) stored in internal flash at power on.
>>>>
>>>> The eCos port for STM32f4-discovery has got a redboot option under
>>>> Packages list in Templates. However it seems to be very
>>>> minimalistic and
>>>> also not functional. Also there is no specific configuration file like
>>>> redboot_ROM.ecm.
>>>>
>>>> Please, could you give me directions as to making a functional redboot
>>>> loader for STM32f4-discovery board.
>>>>
>>>> Would it make sense to build redboot for stm32x0g_eval board (redboot
>>>> seems to be working) and adapt it for STM32f4-discovery board?
>>>>
>>>> I would appreciate any input on this.
>>> To be clear, there is no support for RedBoot in the STM32F4-Discovery
>>> platform HAL at present. The STM32F4-Discovery board offers only 128KiB
>>> of contiguous on-chip RAM, so loading applications into RAM prior to
>>> execution would limit the size of your applications quite considerably.
>>> RedBoot would also consume some of the available RAM for its own data
>>> structures.
>>>
>>> If you are still interested in using RedBoot to load and launch your
>>> applications, you will need to add the following to the
>>> STM32F4-Discovery platform HAL package:
>>>
>>> a) CDL items and memory layout files for RAM startup
>>> b) CDL items for behaving as a ROM monitor and for working with a ROM
>>>     monitor
>>> c) RedBoot-specific CDL items and data structures
>>>
>>> You will find examples of all the above in the STM32x0G_EVAL platform
>>> HAL package, but keep in mind that the STM32x0G_EVAL boards feature
>>> external RAM. The naming of memory regions and startup types is
>>> therefore different. The STM32x0G_EVAL "ROMINT" and "SRAM" startup
>>> types
>>> are broadly equivalent to the STM32F4-Discovery "ROM" and (proposed)
>>> "RAM" startup types respectively.
>> In addition, for example of RedBoot on a platform with only internal RAM
>> you can look at Kinetis.
>>
>> Ilija
>>
>>> I hope this helps...
>>>
>>> John Dallaway
>>> eCos maintainer
>>> http://www.dallaway.org.uk/john
>>>
>>
>
>


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] Re: redboot on STM32f4-discovery board
  2014-10-04 14:27   ` "Ilija Kocho [Илија Кочо]"
@ 2014-10-05  8:32     ` Oleg Uzenkov
  2014-10-05  9:56       ` "Ilija Kocho [Илија Кочо]"
  2014-10-09 15:48     ` [ECOS] " Oleg Uzenkov
  1 sibling, 1 reply; 6+ messages in thread
From: Oleg Uzenkov @ 2014-10-05  8:32 UTC (permalink / raw)
  To: "Ilija Kocho [Илија
	Кочо]",
	John Dallaway
  Cc: eCos Discussion

Hello, John, Ilija,

Thanks for your help!

I will study in depth STM32x0G_EVAL and Kinetis platform HAL packages.

My main goal is to port and use redboot on my own custom board which is 
similar to STM32f4-discovery board (stm32f407VE processor, no external 
ram, 512KB of internal flash, 128KiB  of ram). The custom board has got 
sdcard (with FAT32) though. Redboot should be responsible for loading a 
binary stored in sdcard.

The general steps, it seems to me I need to take, are as follows:

1) add cdl items you mentioned in the previous mail into the board's HAL 
package ( + all what is needed to work with sdcard) -> build redboot.bin
2) load redboot.bin (built as "ROM" startup type)  into internal flash 
at 0x08000000
3) place app.bin file onto sdcard (image need to be built with "RAM" 
startup type)
4) on reset redboot mounts sdcard -> selects a binary and loads it into 
internal flash (at address not overlapping redboot)
5) need to copy app's code to ram for execution and run it (do not know 
how to, probably need startup code?)

Please, could you correct me if I am wrong in the general understanding.

I very much appreciate your help.

Oleg

> On 03.10.2014 13:40, John Dallaway wrote:
>> Hi Oleg
>>
>> On 02/10/14 09:47, Oleg Uzenkov wrote:
>>
>>> I am working with eCos on STM32f4-discovery board.
>>>
>>> I would like to build a redboot loader that could choose and load
>>> binaries (eCos+app) stored in internal flash at power on.
>>>
>>> The eCos port for STM32f4-discovery has got a redboot option under
>>> Packages list in Templates. However it seems to be very minimalistic and
>>> also not functional. Also there is no specific configuration file like
>>> redboot_ROM.ecm.
>>>
>>> Please, could you give me directions as to making a functional redboot
>>> loader for STM32f4-discovery board.
>>>
>>> Would it make sense to build redboot for stm32x0g_eval board (redboot
>>> seems to be working) and adapt it for STM32f4-discovery board?
>>>
>>> I would appreciate any input on this.
>> To be clear, there is no support for RedBoot in the STM32F4-Discovery
>> platform HAL at present. The STM32F4-Discovery board offers only 128KiB
>> of contiguous on-chip RAM, so loading applications into RAM prior to
>> execution would limit the size of your applications quite considerably.
>> RedBoot would also consume some of the available RAM for its own data
>> structures.
>>
>> If you are still interested in using RedBoot to load and launch your
>> applications, you will need to add the following to the
>> STM32F4-Discovery platform HAL package:
>>
>> a) CDL items and memory layout files for RAM startup
>> b) CDL items for behaving as a ROM monitor and for working with a ROM
>>     monitor
>> c) RedBoot-specific CDL items and data structures
>>
>> You will find examples of all the above in the STM32x0G_EVAL platform
>> HAL package, but keep in mind that the STM32x0G_EVAL boards feature
>> external RAM. The naming of memory regions and startup types is
>> therefore different. The STM32x0G_EVAL "ROMINT" and "SRAM" startup types
>> are broadly equivalent to the STM32F4-Discovery "ROM" and (proposed)
>> "RAM" startup types respectively.
> In addition, for example of RedBoot on a platform with only internal RAM
> you can look at Kinetis.
>
> Ilija
>
>> I hope this helps...
>>
>> John Dallaway
>> eCos maintainer
>> http://www.dallaway.org.uk/john
>>
>


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] Re: redboot on STM32f4-discovery board
  2014-10-03 11:40 ` [ECOS] " John Dallaway
@ 2014-10-04 14:27   ` "Ilija Kocho [Илија Кочо]"
  2014-10-05  8:32     ` Oleg Uzenkov
  2014-10-09 15:48     ` [ECOS] " Oleg Uzenkov
  0 siblings, 2 replies; 6+ messages in thread
From: "Ilija Kocho [Илија Кочо]" @ 2014-10-04 14:27 UTC (permalink / raw)
  To: Oleg Uzenkov; +Cc: John Dallaway, eCos Discussion

On 03.10.2014 13:40, John Dallaway wrote:
> Hi Oleg
>
> On 02/10/14 09:47, Oleg Uzenkov wrote:
>
>> I am working with eCos on STM32f4-discovery board.
>>
>> I would like to build a redboot loader that could choose and load
>> binaries (eCos+app) stored in internal flash at power on.
>>
>> The eCos port for STM32f4-discovery has got a redboot option under
>> Packages list in Templates. However it seems to be very minimalistic and
>> also not functional. Also there is no specific configuration file like
>> redboot_ROM.ecm.
>>
>> Please, could you give me directions as to making a functional redboot
>> loader for STM32f4-discovery board.
>>
>> Would it make sense to build redboot for stm32x0g_eval board (redboot
>> seems to be working) and adapt it for STM32f4-discovery board?
>>
>> I would appreciate any input on this.
> To be clear, there is no support for RedBoot in the STM32F4-Discovery
> platform HAL at present. The STM32F4-Discovery board offers only 128KiB
> of contiguous on-chip RAM, so loading applications into RAM prior to
> execution would limit the size of your applications quite considerably.
> RedBoot would also consume some of the available RAM for its own data
> structures.
>
> If you are still interested in using RedBoot to load and launch your
> applications, you will need to add the following to the
> STM32F4-Discovery platform HAL package:
>
> a) CDL items and memory layout files for RAM startup
> b) CDL items for behaving as a ROM monitor and for working with a ROM
>    monitor
> c) RedBoot-specific CDL items and data structures
>
> You will find examples of all the above in the STM32x0G_EVAL platform
> HAL package, but keep in mind that the STM32x0G_EVAL boards feature
> external RAM. The naming of memory regions and startup types is
> therefore different. The STM32x0G_EVAL "ROMINT" and "SRAM" startup types
> are broadly equivalent to the STM32F4-Discovery "ROM" and (proposed)
> "RAM" startup types respectively.

In addition, for example of RedBoot on a platform with only internal RAM
you can look at Kinetis.

Ilija

>
> I hope this helps...
>
> John Dallaway
> eCos maintainer
> http://www.dallaway.org.uk/john
>


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* [ECOS] Re: redboot on STM32f4-discovery board
  2014-10-02  8:47 [ECOS] " Oleg Uzenkov
@ 2014-10-03 11:40 ` John Dallaway
  2014-10-04 14:27   ` "Ilija Kocho [Илија Кочо]"
  0 siblings, 1 reply; 6+ messages in thread
From: John Dallaway @ 2014-10-03 11:40 UTC (permalink / raw)
  To: Oleg Uzenkov; +Cc: eCos Discussion

Hi Oleg

On 02/10/14 09:47, Oleg Uzenkov wrote:

> I am working with eCos on STM32f4-discovery board.
> 
> I would like to build a redboot loader that could choose and load
> binaries (eCos+app) stored in internal flash at power on.
> 
> The eCos port for STM32f4-discovery has got a redboot option under
> Packages list in Templates. However it seems to be very minimalistic and
> also not functional. Also there is no specific configuration file like
> redboot_ROM.ecm.
> 
> Please, could you give me directions as to making a functional redboot
> loader for STM32f4-discovery board.
> 
> Would it make sense to build redboot for stm32x0g_eval board (redboot
> seems to be working) and adapt it for STM32f4-discovery board?
> 
> I would appreciate any input on this.

To be clear, there is no support for RedBoot in the STM32F4-Discovery
platform HAL at present. The STM32F4-Discovery board offers only 128KiB
of contiguous on-chip RAM, so loading applications into RAM prior to
execution would limit the size of your applications quite considerably.
RedBoot would also consume some of the available RAM for its own data
structures.

If you are still interested in using RedBoot to load and launch your
applications, you will need to add the following to the
STM32F4-Discovery platform HAL package:

a) CDL items and memory layout files for RAM startup
b) CDL items for behaving as a ROM monitor and for working with a ROM
   monitor
c) RedBoot-specific CDL items and data structures

You will find examples of all the above in the STM32x0G_EVAL platform
HAL package, but keep in mind that the STM32x0G_EVAL boards feature
external RAM. The naming of memory regions and startup types is
therefore different. The STM32x0G_EVAL "ROMINT" and "SRAM" startup types
are broadly equivalent to the STM32F4-Discovery "ROM" and (proposed)
"RAM" startup types respectively.

I hope this helps...

John Dallaway
eCos maintainer
http://www.dallaway.org.uk/john

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

end of thread, other threads:[~2014-10-10 17:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-10 17:22 [ECOS] Re: redboot on STM32f4-discovery board Oleg Uzenkov
  -- strict thread matches above, loose matches on Subject: below --
2014-10-02  8:47 [ECOS] " Oleg Uzenkov
2014-10-03 11:40 ` [ECOS] " John Dallaway
2014-10-04 14:27   ` "Ilija Kocho [Илија Кочо]"
2014-10-05  8:32     ` Oleg Uzenkov
2014-10-05  9:56       ` "Ilija Kocho [Илија Кочо]"
2014-10-09 15:48     ` [ECOS] " Oleg Uzenkov
2014-10-09 18:44       ` [ECOS] " John Dallaway

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).