Reply to Debugging

  • Posted by: JSalomon • 31 January, 2008
That's a good idea Dien, but how are you going to actually implement and test debugging if you don't have the jtag-usb on your home pc?

Memmap Research

  • Posted by: JSalomon • 31 January, 2008
Those are some pretty good points Evan. I did a little research, will try this when I get into the lab.
Linking a program to a location != 0x0000

Maybe not as relevant, but could be helpful: Boot Monitors and remapping interrupt vectors


Debugging

  • Posted by: DNguyen • 31 January, 2008
I've trying to fool around with the eclipe IDE and get debugging working. IT would be great if we can somehow see what happens in the chip and narrow down problems rather than troubling shooting in the dark.

THere's a great tutortial how to create Eclipse from scratch. I'm going to follow it on my PC to see where it goes.

http://forum.sparkfun.com/viewtopic.php?t=1331&postdays=0&postorder=asc&start=60

Possible Ideas

  • Posted by: ENg • 30 January, 2008
Asked Matt about the flash erasing issue we're having. He said he didn't know offhand, but that perhaps there's a register or something we need to write to in order for us to be able to fully erase and write on the memory locations.

Looking at the LPC2292 documentation, it mentioned that there were some interrupt vectors that start at memory address 0x00000000. I might be dumb and not know what I'm talking about, but perhaps we're trying to write the bin file over the interrupt vectors on the same memory locations, which is causing a conflict. Page 74/306 in the user manual starts to talk about memory mapping control and I think how to alter where the interrupts are located. I'd look into it more but I have volleyball practice now. User manual link is here: http://www.keil.com/dd/docs/datashts/philips/user_manual_lpc2119_2129_2194_2292_2294.pdf

Random Tests

  • Posted by: BWoo • 28 January, 2008
Project: FreeRTOS_NG

Tried to do random tests to see if the bin file was writing to the board but to no avail. No hard changes made to any of the files. Just did a bunch of tests and reverted back to original. I thought it was a flash bank association like my previous post in November but nope it wasn't that issue. Going to the gym for a bit. Might be back later today.

Hooray

  • Posted by: JSalomon • 26 January, 2008
Project: FreeRTOS_Ng (made backup before I made changes)

Well I don't know if the code actually works, but I modified the makefile so it produced a .bin for flashing.

I tried changing the linker script ram size to 16K, but got errors when running ram_arm.bat. I changed it back to 64K and it compiled fine. I'm also not sure which one we're supposed to run (rom, ram, arm, thumb). I'll do more research on that.

I think it works?

  • Posted by: ENg • 25 January, 2008
So, some guy answered Joe's yahoo group post and said to try and use Yagarto. I didn't try that, but he did mention using the proper build instructions from the website.

I created a new project, FreeRTOS_Ng. Apparently, we're supposed to build the demo code using the batch files first, not through Eclipse or anything. So in my new project I copied the files over and ran rom_thumb.bat in a command prompt. No errors in the outputs, all corresponding .o files, hex's and all that good stuff was made with no problems. Imported those files into the Eclipse project (they're all in the Demo folder right now). Tried cleaning the project in eclipse, works like a charm. I tried building too, but got one of those "No rule to make target all" or whatever we used to get, nothing crazy.

I say we run with this. As far as we know, this is working code that we haven't screwed up yet. I can't do anymore today, but the port modifying tutorial on freertos.org is remotely basic enough that anyone can pick it up. The link to the tutorial is in my last or 2nd to last post. Sorry I'm too lazy to copy and paste it.

Trying random crap

  • Posted by: JSalomon • 25 January, 2008
Project: 2368

So thankfully someone replied quickly to my post here Yahoo group. Using that advice, I went around just deleting (Evan said commenting may not fully take it out) all the "thumb-interwork" references.

This produced a different error:

FreeRTOS/Source/portable/MemMang/heap_2.o boot.s -nostartfiles -Xlinker -oRTOSDemo.elf -Xlinker -M -Xlinker -Map=rtosdemo1.map
/cygdrive/c/gccfd/gnuarm/bin/../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/bin/ld: region ram is full (RTOSDemo.elf section .bss)
collect2: ld returned 1 exit status

To fix this, I was researching these sites:
Out of ram post and FreeRTOS Memory Management.

I'm done for the night, so feel free to add, or work on the 2106 project. Check this new post I just did for any replies. Post


An alternative..

  • Posted by: JSalomon • 24 January, 2008
Project: FreeRTOS_port_2368

The 2106 memory overlap errors were pissing me off so I'm working on this one.
Changes:
Source/portable/GCC/ARM7_LPC2000/port.c: changed some variable names to coincide with lpc23xx.h
Now I'm getting assembler errors. wtf

Be back later after groceries and class.

Some status

  • Posted by: BWoo • 23 January, 2008
File Name: Makefile

Since it is clear that we are working with only one project FreeRTOS_port_2106 I won't mention it on the top.

Worked with Evan, Joe and Prof. Matt. Edited the Makefile and found a TAB character at the end of one of the lines. Build goes past the Makefile.
----------------------------------------------------------------
File Name: lpc2368.ld

Joe added some lines in this file in order to correct the .init error.
Added Lines:
KEEP(*(.init))
KEEP(*(.fini))
KEEP(*(.eh_frame))
KEEP(*(.jcr))
...
.ctors :
{
     PROVIDE(__ctors_start__ = .);
     KEEP(*(SORT(.ctors.*)))
     KEEP(*(.ctors))
     PROVIDE(__ctors_end__ = .);
} >FLASH
.dtors :
{
     PROVIDE(__dtors_start__ = .);
     KEEP(*(SORT(.dtors.*)))
     KEEP(*(.dtors))
     PROVIDE(__dtors_end__ = .);
} >FLASH

Error Message [ld]:
section .ctors [00000000 -> 00000007] overlaps section prog [00000000 -> 00006883]
section .dtors [00000008 -> 0000000f] overlaps section prog [00000000 -> 00006883]
startfiles: section prog lma 0x0 overlaps previous sections
startfiles: section .dtors lma 0x8 overlaps previous sections

Checking the error message, it seems like the program memory mapping is in conflict with the .ctors and .dtors memory mapping. Going to read more on how the ld and s files work in conjunction with each other. There are more undeclared variables. Maybe some files are not linked again but not sure yet. One piece at a time. I can't concentrate right now so I will look at this again tomorrow.

Edit: The prog memory location is specified in the file rtosdemo.map

So close...I think

  • Posted by: ENg • 22 January, 2008
Worked with Brwoo on FreeRTOS_port_2106 today. We managed to resolve the .o file errors by playing around with the directory paths. We did some referencing to Matt's code and was able to get them to work. No real huge changes, but we did all our work within the Makefile. Now that those errors are gone, we now have like 85 or so errors while compiling main.c about undefined function references. These errors are not real, because the functions are defined in header files that we already have. (For example: the first error is for vStartIntegerMathTasks, which can be found in Demo/Common/include/integer.h) Initially, it looks like the compiler is not including the entire include folder within the Demo/Common directory, despite the include statements in main.c. It's probably some kind of path issue, in the directory path the compiler uses does not contain the headers we need. However if you go to the Outline column on the right of the Eclipse window, you can double click any of the includes and they'll open up, containing the functions we need. So I'm not really sure what to do.

Steps I've tried:
- Copied the Demo/Common/include folder into the project path. Did not change anything.
- Copied integer.h directly into the project folder to attempt to eliminate the first error for vStartIntegerMathTasks, but this also proved to be unsuccessful.

I have practice from 4-6 tomorrow. I'll try to come in from like 1-4 and 6-9 or something. It's early in the semester, we should be able to put in a lot of hours to get this FreeRTOS thing up. Deadline is this Friday to get it running.

2106 Demo modifications

  • Posted by: JSalomon • 22 January, 2008
Project: FreeRTOS_port_2106
Files: various

I was working on Dien's previous demo since it was the one I was going to do myself anyway. I'm just typing this in as I go along so I don't forget anything.

-Copied Demo/Common folder to project
-Copied lpc2368.ld and crt.s (renamed to boot.s) from demoblink_flash
-Fixed some macro names and directory structures in Makefile
-Added include paths for Demo/Common/minimal, demo/common/include, source/include, source/portable/gcc/arm7_lpc2000
-Copied rtosdemo.map from FreeRTOS_port_2368

Makefile is somewhat making, except there are still some errors in detecting the .o files.

I've got class tonight so I'll be in here more tomorrow.


Nothing Yet, Sorry.

  • Posted by: BWoo • 22 January, 2008
Project: FreeRTOS_port_2368_Woo
File: [None]

Created a new project called FreeRTOS_port_2368_Woo. Just checked the contents of the files a bit. No modification yet. I did some trials with the old project FreeRTOS to see the functionality of some of the files but no hard modifications to any of the files. Will be back later today to do some more debugging at the lab and more research at the dorm.

Project clarification

  • Posted by: JSalomon • 17 January, 2008
Sorry, I should have let everyone know which was which.

The RTOSDemo_11_19 project is the one I was previously working on since last sem. In it I have pretty much followed the tutorial that evan just posted. Except that I have also added header file includes to some .c files to get rid of "function not defined" errors.

The FreeRTOS project is the one Evan is currently working on, also doing the tutorial.

I don't know if you guys want to keep redoing the tutorial, but like I said, it's a linker issue (or maybe makefile) when the project is being made. That's why I've been working on examining the makefiles for previously built projects (Matt's and demo_blink).

*EDIT: Dien made me realize I was modifying a port of the 2368, as per the instructions from this post: Embeddedrelated. It's good you guys are starting from scratch and either trying different ports or making a new one. Good call. I will probably abandon trying to dissect the makefiles for now and focus on helping with the ports.

File Organization

  • Posted by: DNguyen • 17 January, 2008
I tried getting Evan's RTOSDEMO_11_19 to work by commenting out the header files in the main.c but to no avail. Is the FreeRTOS the one we're working on for the 2292 uc?

there's a tutorial we posted a few months ago for the 2106, tomorrow i'm gonna follow that one and see how it turns out.

Starting FreeRTOS

  • Posted by: ENg • 17 January, 2008
Kind of started up on the FreeRTOS stuff. Created a new project called FreeRTOS within Eclipse. I'm following a tutorial on the website.
http://www.freertos.org/porting-a-freertos-demo-to-different-hardware.html

It gives a fairly straightforward process on how to modify an existing demo application. So in our case, we're modifying the demo for the LPC2106. Copied the source and demo files into the new project. The first steps of the tutorial say to upload the demo and try to see if it will compile on its own, without our modifications. Having trouble getting it to build, need to fix some issues in the Makefile. Should try to reference the Makefile from the RTOSDemo_11_19 project, there are some discrepancies between them that might be causing the issues. Once we get it to compile we can continue on to the next steps.

Todo

  • Posted by: JSalomon • 17 January, 2008
Because I have class soon, just wanted to post this stuff up:

Eclipse SVN Plugin (I didn't get to install this b/c Evan was on the computer):Subclipse


I'm going to compare Matt's old FreeRTOS port makefile with ours.
sam7
lpc
blinkdemo

Make Errors

Anyone else can help, but I posted this so I can do it on my computer at home as well. Upload editted versions if needed.

A little off-topic. But we're now the 4th Result in Google when searching for "freertos lpc2292" haha.