EmbeddedRelated.com
Forums

LPC2368 + FreeRTOS

Started by "Jorge S." October 15, 2008
IT WORKS!!!!!!!!!!!

Kristiansen, you were right!, just moved the _bss_end=. lines from the
bottom of the lpc2368.ld to the line 45 and it works fine, no other
modifications needed. I wasn't understanding well your intructions
when i first readed your post, and that's why it wasnt working (my
fault).

Richard,

Do you want me to send the lpc2368.ld file? Maybe it can help other
people getting a demo running out-of-the-box.

Now its time to explore this wonderful piece of software :).

Thank you guys!.

On Fri, Oct 17, 2008 at 8:43 AM, Kristiansen Mikkel Roth
wrote:
> Hello,
>
> my suggestion about deleting the bss section was strictly meant as a small
> test - sorry for not making my suggestion more accurate. Richard's point
> about initialising the bss data area is correct.
> The fix that I have used, moving the bss_end line in the lpc23xx.ld file,
> did make my lpc2387 port run . I think it's worth a try.
> Best regards
> Mikkel Kristiansen
> Product development - controls
>
> Danfoss
> District Heating controls
> Office E39, 6430 Nordborg, Denmark
> Tel.: +45 7488 2745 / Mobile: -
> Fax: +45 7449 0950
> E-mail: m...@danfoss.com
> www.danfoss.com
>
> ________________________________
>
> From: l... [mailto:l...] On Behalf Of
> Jorge S.
> Sent: 16. oktober 2008 20:47
> To: l...
> Subject: Re: [lpc2000] LPC2368 + FreeRTOS
>
> I'm using heap_2.c (it comes as default on the demo makefile).
>
> Just diving again....i can confirm that it gets stuck at a while loop
> located at heap_2.c
> on line 193.
>
> This is the loop:
>
> while( ( pxBlock->xBlockSize < xWantedSize ) && (
> pxBlock->pxNextFreeBlock ) )
> {
> pxPreviousBlock = pxBlock;
> pxBlock = pxBlock->pxNextFreeBlock;
> }
>
> It loops forever....
>
> And yes, i've removed that bss initialization section as Kristiansen
> sugested early on this thread. If i don't remove the bss initialization, the
> demo simply doesn't work :(.
>
> So ...steps i did so far:
>
> 1) Uncompressed the Source and issued a "make" on the lpc2368_Eclipse
> demo...
> Results: Not working.
>
> 2) Commented demo main() function and replaced with some led candy...
> Results: Not working
>
> 3) As Kristian sugested i deleted de bss init code.
> Results: Now my led eye candy works fine!
>
> 4) Commented my led test main() function and uncommented the demo main()
> function
> Results: Demo gets frozen on the while() loop i described before.
>
> Any idea?
>
> You guys are really helping me ...consider yourself "free beer awarded" if
> you ever come to spain :)
>
> Regards,
>
> Jorge.
>
> On Thu, Oct 16, 2008 at 8:29 PM, FreeRTOS.org Info > >wrote:
>
>> Which heap_x.c file are you including in your project? (there are three
>> heap_1, heap_2 and heap_3)
>>
>> Did you say you had removed some section initialisation from the start-up
>> file? That could cause problems if you have uninitialised variables.
>> Regards,
>> Richard.
>>
>> + http://www.FreeRTOS.org
>> 17 official architecture ports, more than 6000 downloads per month.
>>
>> + http://www.SafeRTOS.com
>> Certified by T as meeting the requirements for safety related systems.
>>
>> > -----Original Message-----
>> > From: l...
>> >
>> > [mailto:l...
>> > ] On Behalf
>> Of Jorge S.
>> > Sent: 16 October 2008 19:19
>> > To: l...
>> >
>> > Subject: Re: [lpc2000] LPC2368 + FreeRTOS
>> >
>> > Hi again,
>> >
>> > Just diving into the xQueueCreate() function code i can
>> > confirm that it gets stuck when calling pvportmalloc().
>> >
>> > Maybe something wrong with my libc malloc() function? how can
>> > i solve this?
>> > My toolchain uses newlibc.
>> >
>> > On Thu, Oct 16, 2008 at 7:06 PM, Jorge S.
>> >
>> > >> jorgesolla%40gmail.com > > wrote:
>> >
>> > > Hi,
>> > >
>> > > As suggested here, i have checked the 4.0.8 version of
>> > boot.s but it's
>> > > the same file wich comes with the version 5.0.4 version (the only
>> > > changes are the missing .bss section lines that i've deleted)
>> > >
>> > > Just deleted the "Clear BSS" section of the boot.s file and now it
>> > > partially works.
>> > >
>> > > My leds are now OK, so my main() test function is working, i can
>> > > switch leds on/off. But when i uncomment the demo main() it
>> > gets stuck
>> > > on the very first API call:
>> > >
>> > > xLCDQueue = xQueueCreate( mainQUEUE_SIZE, sizeof( xLCDMessage ) );
>> > >
>> > >
>> > > Having a look at my RTOSDemo.map file i can see that sections .data
>> > > and .bss look like overlapping.
>> > > This is what my .map file looks like:
>> > >
>> > >
>> > >
>> > > ..
>> > > ..
>> > >
>> > > .data 0x400008bc 0x0
>> > >
>> > /opt/devkitpro/devkitARM/lib/gcc/arm-eabi/4.3.0/thumb/libgcc.a(_muldiv
>> > > df3.o)
>> > > .data 0x400008bc 0x0
>> > >
>> > /opt/devkitpro/devkitARM/lib/gcc/arm-eabi/4.3.0/thumb/libgcc.a(_cmpdf2
>> > > .o)
>> > > .data 0x400008bc 0x0
>> > >
>> > /opt/devkitpro/devkitARM/lib/gcc/arm-eabi/4.3.0/thumb/libgcc.a(_fixdfs
>> > > i.o)
>> > > .data 0x400008bc 0x0
>> > >
>> > /opt/devkitpro/devkitARM/lib/gcc/arm-eabi/4.3.0/../../../../arm-eabi/l
>> > > ib/thumb/libg.a(lib_a-malloc.o)
>> > > 0x400008bc __data_end__ = .
>> > >
>> > > .bss 0x400008bc 0x737c
>> > > 0x400008bc __bss_beg__ = .
>> > > *(.bss)
>> > > .bss 0x400008bc 0x0
>> > > ../../../Source/portable/GCC/ARM7_LPC23xx/portISR.o
>> > > .bss 0x400008bc 0x0 ./webserver/EMAC_ISR.o .bss 0x400008bc
>> > 0x8 main.o
>> > > .bss 0x400008c4 0x0 ./ParTest/ParTest.o .bss 0x400008c4 0x4
>> > > ./LCD/portlcd.o .bss 0x400008c8 0x18 ../../Common/Minimal/BlockQ.o
>> > >
>> > >
>> > >
>> > >
>> > > Can you see things overlapping at address 0x400008bc?? or am i
>> > > misunderstanding the .map file?
>> > >
>> > > Thanks for helping :)
>> > >
>> > > Regards,
>> > > Jorge.
>> > >
>> > >
>> > >
>> > >
>> > > On Wed, Oct 15, 2008 at 9:16 PM, Kristiansen Mikkel Roth <
>> > > m...@danfoss.com
>> > >
>> >
>> > >
>> > wrote:
>> > >
>> > >> Hello,
>> > >>
>> > >> try to delete or comment out the "Clear BSS" section of the boot.s
>> > >> file, lines 72-89. (The problem I had is shortly explained
>> > in message
>> > >> ID 36512, http://tech.groups.yahoo.com/group/lpc2000/message/36512
>> > >>
>> > >> >> > >> > )
>> > >>
>> > >>
>> > >> See LPC2356 Errata sheet for processor markings.
>> > >>
>> > >>
>> > >> Best regards
>> > >> Mikkel Kristiansen
>> > >>
>> > >> ________________________________
>> > >>
>> > >> From: l...
>> > >>
>> > >
>> > [mailto:
>> > >> l...
>> > >> >> lpc2000%40yahoogroups.com >
>> > >> ] On Behalf Of Jorge S.
>> > >> Sent: 15. oktober 2008 20:18
>> > >> To: l...
>> > >> >> lpc2000%40yahoogroups.com >
>> > >>
>>
>> > >> Subject: [lpc2000] LPC2368 + FreeRTOS
>> > >>
>> > >>
>> > >> Hello all:
>> > >>
>> > >> I'm just trying to install FreeRTOS on a LPC2368
>> > Development board,
>> > >> and it doesn't works even when replacing main() function with a
>> > >> simple led example.
>> > >>
>> > >> My host is an Ubuntu Linux, with a devkitARM toolchain. (Toolchain
>> > >> has been sucessfully tested, i can compile lots of working
>> > examples,
>> > >> leds, serial ports, timers, and so on)
>> > >>
>> > >> Steps i did on the ARM7_LPC2368_Eclipse demo:
>> > >>
>> > >> 1) Checked FreeRTOSConfig.h file -> It seems to be
>> > expecting a 12Mhz
>> > >> main OSC, and thats what i have on my board.
>> > >> Both of the "#define configPINSEL2_VALUE " options tested, none is
>> > >> working :(.
>> > >>
>> > >> 2) Just following the docs, i've replaced the main()
>> > function with my
>> > >> own
>> > >> main():
>> > >>
>> > >> int main( void )
>> > >> {
>> > >> // Board has 2 leds tied to P3.25 & P3.26, and they are ON
>> > when pin
>> > >> is tied to GND
>> > >> FIO3DIR=(1<<25) | (1<<26);
>> > >> FIO3SET=(1<<26);
>> > >> while (1);
>> > >> }
>> > >>
>> > >> Everything builds OK (no errors, no warnings), and i get a
>> > >> RTOSDemo.hex file wich i upload to the uC using serial ISP
>> > using the
>> > >> lpc21isp tool, but the program isn't running, i don't see the LED
>> > >> (p3.26) ON.
>> > >>
>> > >> Pd: Same main() test function works fine with my usual
>> > test makefile.
>> > >>
>> > >> Any ideas? Maybe i'm missing any configuration? What can i check?
>> > >>
>> > >> How can i identify if i have a REV A. version of the LPC2368?
>> > >>
>> > >> Thanks in advance.
>> > >>
>> > >> Regards,
>> > >>
>> > >> Jorge.
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >
>> > >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>>
>
>
>
>

An Engineer's Guide to the LPC2100 Series

Yes please - can you send it to r _dot_ barry [at] freertos.org.

Thanks.

Regards,
Richard.

+ http://www.FreeRTOS.org
17 official architecture ports, more than 6000 downloads per month.

+ http://www.SafeRTOS.com
Certified by T as meeting the requirements for safety related systems.



> -----Original Message-----
> From: l...
> [mailto:l...] On Behalf Of Jorge S.
> Sent: 17 October 2008 12:41
> To: l...
> Subject: Re: [lpc2000] LPC2368 + FreeRTOS
>
> IT WORKS!!!!!!!!!!!
>
> Kristiansen, you were right!, just moved the _bss_end=. lines
> from the bottom of the lpc2368.ld to the line 45 and it works
> fine, no other modifications needed. I wasn't understanding
> well your intructions when i first readed your post, and
> that's why it wasnt working (my fault).
>
> Richard,
>
> Do you want me to send the lpc2368.ld file? Maybe it can help
> other people getting a demo running out-of-the-box.
>
> Now its time to explore this wonderful piece of software :).
>
> Thank you guys!.
>
> On Fri, Oct 17, 2008 at 8:43 AM, Kristiansen Mikkel Roth
> > > wrote:
> > Hello,
> >
> > my suggestion about deleting the bss section was strictly
> meant as a
> > small test - sorry for not making my suggestion more accurate.
> > Richard's point about initialising the bss data area is correct.
> > The fix that I have used, moving the bss_end line in the lpc23xx.ld
> > file, did make my lpc2387 port run . I think it's worth a try.
> >
> >
> > Best regards
> > Mikkel Kristiansen
> > Product development - controls
> >
> > Danfoss
> > District Heating controls
> > Office E39, 6430 Nordborg, Denmark
> > Tel.: +45 7488 2745 / Mobile: -
> > Fax: +45 7449 0950
> > E-mail: m...@danfoss.com
> >
> > www.danfoss.com
> >
> > ________________________________
> >
> > From: l...
> > [mailto:l...
> ] On Behalf Of Jorge S.
> > Sent: 16. oktober 2008 20:47
> > To: l...
> > Subject: Re: [lpc2000] LPC2368 + FreeRTOS
> >
> > I'm using heap_2.c (it comes as default on the demo makefile).
> >
> > Just diving again....i can confirm that it gets stuck at a
> while loop
> > located at heap_2.c on line 193.
> >
> > This is the loop:
> >
> > while( ( pxBlock->xBlockSize < xWantedSize ) && (
> > pxBlock->pxNextFreeBlock ) )
> > {
> > pxPreviousBlock = pxBlock;
> > pxBlock = pxBlock->pxNextFreeBlock;
> > }
> >
> > It loops forever....
> >
> > And yes, i've removed that bss initialization section as
> Kristiansen
> > sugested early on this thread. If i don't remove the bss
> > initialization, the demo simply doesn't work :(.
> >
> > So ...steps i did so far:
> >
> > 1) Uncompressed the Source and issued a "make" on the
> lpc2368_Eclipse
> > demo...
> > Results: Not working.
> >
> > 2) Commented demo main() function and replaced with some
> led candy...
> > Results: Not working
> >
> > 3) As Kristian sugested i deleted de bss init code.
> > Results: Now my led eye candy works fine!
> >
> > 4) Commented my led test main() function and uncommented the demo
> > main() function
> > Results: Demo gets frozen on the while() loop i described before.
> >
> > Any idea?
> >
> > You guys are really helping me ...consider yourself "free beer
> > awarded" if you ever come to spain :)
> >
> > Regards,
> >
> > Jorge.
> >
> > On Thu, Oct 16, 2008 at 8:29 PM, FreeRTOS.org Info
> >
> >wrote:
> >
> >> Which heap_x.c file are you including in your project? (there are
> >> three heap_1, heap_2 and heap_3)
> >>
> >> Did you say you had removed some section initialisation from the
> >> start-up file? That could cause problems if you have
> uninitialised variables.
> >>
> >>
> >> Regards,
> >> Richard.
> >>
> >> + http://www.FreeRTOS.org
> >> + >
> >> 17 official architecture ports, more than 6000 downloads per month.
> >>
> >> + http://www.SafeRTOS.com
> >> + >
> >> Certified by T as meeting the requirements for safety
> related systems.
> >>
> >> > -----Original Message-----
> >> > From: l...
>
> >> >
> >> >
> >> > [mailto:l...
>
> >> >
> >> > ] On Behalf
> >> Of Jorge S.
> >> > Sent: 16 October 2008 19:19
> >> > To: l...
> >> >
> >> >
> >> > Subject: Re: [lpc2000] LPC2368 + FreeRTOS
> >> >
> >> > Hi again,
> >> >
> >> > Just diving into the xQueueCreate() function code i can confirm
> >> > that it gets stuck when calling pvportmalloc().
> >> >
> >> > Maybe something wrong with my libc malloc() function? how can i
> >> > solve this?
> >> > My toolchain uses newlibc.
> >> >
> >> > On Thu, Oct 16, 2008 at 7:06 PM, Jorge S.
> >> >
> >> > > >> jorgesolla%40gmail.com > > wrote:
> >> >
> >> > > Hi,
> >> > >
> >> > > As suggested here, i have checked the 4.0.8 version of
> >> > boot.s but it's
> >> > > the same file wich comes with the version 5.0.4
> version (the only
> >> > > changes are the missing .bss section lines that i've deleted)
> >> > >
> >> > > Just deleted the "Clear BSS" section of the boot.s
> file and now
> >> > > it partially works.
> >> > >
> >> > > My leds are now OK, so my main() test function is
> working, i can
> >> > > switch leds on/off. But when i uncomment the demo main() it
> >> > gets stuck
> >> > > on the very first API call:
> >> > >
> >> > > xLCDQueue = xQueueCreate( mainQUEUE_SIZE, sizeof(
> xLCDMessage )
> >> > > );
> >> > >
> >> > >
> >> > > Having a look at my RTOSDemo.map file i can see that sections
> >> > > .data and .bss look like overlapping.
> >> > > This is what my .map file looks like:
> >> > >
> >> > >
> >> > >
> >> > > ..
> >> > > ..
> >> > >
> >> > > .data 0x400008bc 0x0
> >> > >
> >> >
> /opt/devkitpro/devkitARM/lib/gcc/arm-eabi/4.3.0/thumb/libgcc.a(_mul
> >> > div
> >> > > df3.o)
> >> > > .data 0x400008bc 0x0
> >> > >
> >> >
> /opt/devkitpro/devkitARM/lib/gcc/arm-eabi/4.3.0/thumb/libgcc.a(_cmp
> >> > df2
> >> > > .o)
> >> > > .data 0x400008bc 0x0
> >> > >
> >> >
> /opt/devkitpro/devkitARM/lib/gcc/arm-eabi/4.3.0/thumb/libgcc.a(_fix
> >> > dfs
> >> > > i.o)
> >> > > .data 0x400008bc 0x0
> >> > >
> >> >
> /opt/devkitpro/devkitARM/lib/gcc/arm-eabi/4.3.0/../../../../arm-eab
> >> > i/l
> >> > > ib/thumb/libg.a(lib_a-malloc.o)
> >> > > 0x400008bc __data_end__ = .
> >> > >
> >> > > .bss 0x400008bc 0x737c
> >> > > 0x400008bc __bss_beg__ = .
> >> > > *(.bss)
> >> > > .bss 0x400008bc 0x0
> >> > > ../../../Source/portable/GCC/ARM7_LPC23xx/portISR.o
> >> > > .bss 0x400008bc 0x0 ./webserver/EMAC_ISR.o .bss 0x400008bc
> >> > 0x8 main.o
> >> > > .bss 0x400008c4 0x0 ./ParTest/ParTest.o .bss 0x400008c4 0x4
> >> > > ./LCD/portlcd.o .bss 0x400008c8 0x18
> >> > > ../../Common/Minimal/BlockQ.o
> >> > >
> >> > >
> >> > >
> >> > >
> >> > > Can you see things overlapping at address 0x400008bc?? or am i
> >> > > misunderstanding the .map file?
> >> > >
> >> > > Thanks for helping :)
> >> > >
> >> > > Regards,
> >> > > Jorge.
> >> > >
> >> > >
> >> > >
> >> > >
> >> > > On Wed, Oct 15, 2008 at 9:16 PM, Kristiansen Mikkel Roth <
> >> > > m...@danfoss.com
> >> > >
> >> > >
> >> > >
> >> >
> >> >
> > >> > foss.com>>
> >> > wrote:
> >> > >
> >> > >> Hello,
> >> > >>
> >> > >> try to delete or comment out the "Clear BSS" section of the
> >> > >> boot.s file, lines 72-89. (The problem I had is shortly
> >> > >> explained
> >> > in message
> >> > >> ID 36512,
> >> > >> http://tech.groups.yahoo.com/group/lpc2000/message/36512
> >> > >>
> >> > >> > >> > >> >
> >> > >> > >> > >>
> >> > >> > >> > >>
> > > )
> >> > >>
> >> > >>
> >> > >> See LPC2356 Errata sheet for processor markings.
> >> > >>
> >> > >>
> >> > >> Best regards
> >> > >> Mikkel Kristiansen
> >> > >>
> >> > >> ________________________________
> >> > >>
> >> > >> From: l...
>
> >> > >>
> >> > >>
> >> > >
> >> > [mailto:
> >> > >> l...
> >> > >>
> >> > >> > >> lpc2000%40yahoogroups.com >
> >> > >> ] On Behalf Of Jorge S.
> >> > >> Sent: 15. oktober 2008 20:18
> >> > >> To: l...
>
> >> > >>
> >> > >> > >> lpc2000%40yahoogroups.com >
> >> > >>
> >>
> >> > >> Subject: [lpc2000] LPC2368 + FreeRTOS
> >> > >>
> >> > >>
> >> > >> Hello all:
> >> > >>
> >> > >> I'm just trying to install FreeRTOS on a LPC2368
> >> > Development board,
> >> > >> and it doesn't works even when replacing main()
> function with a
> >> > >> simple led example.
> >> > >>
> >> > >> My host is an Ubuntu Linux, with a devkitARM toolchain.
> >> > >> (Toolchain has been sucessfully tested, i can compile lots of
> >> > >> working
> >> > examples,
> >> > >> leds, serial ports, timers, and so on)
> >> > >>
> >> > >> Steps i did on the ARM7_LPC2368_Eclipse demo:
> >> > >>
> >> > >> 1) Checked FreeRTOSConfig.h file -> It seems to be
> >> > expecting a 12Mhz
> >> > >> main OSC, and thats what i have on my board.
> >> > >> Both of the "#define configPINSEL2_VALUE " options
> tested, none
> >> > >> is working :(.
> >> > >>
> >> > >> 2) Just following the docs, i've replaced the main()
> >> > function with my
> >> > >> own
> >> > >> main():
> >> > >>
> >> > >> int main( void )
> >> > >> {
> >> > >> // Board has 2 leds tied to P3.25 & P3.26, and they are ON
> >> > when pin
> >> > >> is tied to GND
> >> > >> FIO3DIR=(1<<25) | (1<<26);
> >> > >> FIO3SET=(1<<26);
> >> > >> while (1);
> >> > >> }
> >> > >>
> >> > >> Everything builds OK (no errors, no warnings), and i get a
> >> > >> RTOSDemo.hex file wich i upload to the uC using serial ISP
> >> > using the
> >> > >> lpc21isp tool, but the program isn't running, i don't see the
> >> > >> LED
> >> > >> (p3.26) ON.
> >> > >>
> >> > >> Pd: Same main() test function works fine with my usual
> >> > test makefile.
> >> > >>
> >> > >> Any ideas? Maybe i'm missing any configuration? What
> can i check?
> >> > >>
> >> > >> How can i identify if i have a REV A. version of the LPC2368?
> >> > >>
> >> > >> Thanks in advance.
> >> > >>
> >> > >> Regards,
> >> > >>
> >> > >> Jorge.
> >> > >>
> >> > >>
> >> > >>
> >> > >>
> >> > >>
> >> > >>
> >> > >>
> >> > >
> >> > >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >>
> >>
> >>
> >
> >
> >
> >
> >
> >
>
>
>
>

We able to intilise the Disk through the programme and calculate the size of SDMMC card. However there is some problem in initializing the filesystem.
This below messageis captured in the Hyperterminal.
/***********************************************************/
MMC/SD Card Filesystem Test (P:LPC2138 L:EFSL)

(We have made changes to header files)

efsl LPC2000-port and this Demo-Application
CARD init...spiInit for SSP/SPI1
Card is initialising.
CSD: 00 6F 00 32 5B 59 83 BD F6 DB DF FF 0A 40 40 F7
Drive Size is 1004535808 Bytes (1961984 Sectors)
Init done...
failed with -2

Any suggestion to over this pl?
__________________________________________________



formatted the SD Card afresh....

Now it works..

Thanks
--- On Sat, 10/18/08, Natarajan N wrote:

From: Natarajan N
Subject: Re: [lpc2000] LPC2148 and sdmmc 1 GB
To: l...
Date: Saturday, October 18, 2008, 11:27 AM

We able to intilise the Disk through the programme and calculate the size of SDMMC card. However there is some problem in initializing the filesystem.
This below messageis captured in the Hyperterminal.
/*********** ********* ********* ********* ********* ********* ***/
MMC/SD Card Filesystem Test (P:LPC2138 L:EFSL)

(We have made changes to header files)

efsl LPC2000-port and this Demo-Application
CARD init...spiInit for SSP/SPI1
Card is initialising.
CSD: 00 6F 00 32 5B 59 83 BD F6 DB DF FF 0A 40 40 F7
Drive Size is 1004535808 Bytes (1961984 Sectors)
Init done...
failed with -2

Any suggestion to over this pl?

____________ _________ _________ _________ _________ __