Demo zips

  • Posted by: JSalomon • 24 February, 2008
sam7

demoblink 2106

Hmm I thought I'd need to zip up all the project files, but I forgot we're analyzing the original projects and how they work with their respective boards. It's obviously all available online.

Another helpful link: Eclipse 2294 Blink demo It's made in eclipse so that's good.


Late post, sorry

  • Posted by: BWoo • 22 February, 2008
Project Name: FreeRTOS_Ng

Went to the lab on Wednesday found the following stuff:
Problem: When the debugger was at 10%
My Solution (I think): Telnet using 4444, and "halt" the device.
Notes:
- After halting the device, you can check the debugger that the process is there and you can see the registers on the upper-right pane. (If not there, show the tab by going to "Windows" button)
- You can also see the assembly code at the right-most pane and the breakpoint that was set.

I tried a few tests with the OCD user commands "reset run_and_init" and "reset run_and_halt" to see anything different but I cannot see the breakpoint in the C code. I had the PC to be very low values and attempt to do a step-into to run each assembly byte but could not duplicate again.

As for Evan's issue with relocating the interrupt vectors to a different location, I think I have an idea to do that by going to the boot.s but for some reason the "Reset_Handler" is not there.... Maybe that could be the issue why it is not starting up correctly. Check the Senior D website for more info on the Reset_Handler in the CRT.S file. You can check this link which goes to the file directly.

lame

  • Posted by: JSalomon • 21 February, 2008
So I thought I had a solution to flash the board using IAR. Since there's no out-of-the box support for the olimex jtag, I had to run the hjtag server. However the hjtag didn't see the board, friggin a; probably an issue with the jtag running on a non-parallel port. Which is weird b/c in the device manager there's an olimex USB serial port (com4) for the jtag, wth. I'll do some more research on this. Keil doesn't come with olimex jtag support either lame.

Possibly different direction

  • Posted by: JSalomon • 21 February, 2008
Since the eclipse debugger isn't working out too well for us, and Evan mentioned he might have heard Matt say it was broken, we're going to try to work without it and see what's up with the code that is flashed onto the board. So everyone should take that approach.

In terms of alternatives I've downloaded IAR and got FreeRTOS to build. I'm trying to figure out how to actually flash it on there though. I figure if the opensource solution doesn't work as easily, maybe a commercial app will. Crossworks didn't build right since it was an older cracked version and the current evaluation version doesn't let me build.

Evan's going to try and examine the .bin file to see if it's flashing correctly.


bah

  • Posted by: JSalomon • 19 February, 2008
worked with the debugger, tried different projects; no progress. i basically redid what evan did. i'll do more research tomorrow.

Debugger: Not much progress, but an observation

  • Posted by: ENg • 14 February, 2008
Played around with the debugger for FreeRTOS_Ng for a while in the lab. Tried it for both ports 3333 and 4444.

3333:
-If I put all the commands in the debug from the Lynch tutorial (replacing main.out with rtosdemo.elf), I get to the 10% launching part that successfully crashes Eclipse. Note: unplugging the JTAG can resolve this problem without having to restart the entire Eclipse environment.
-If I take out the "continue" command, the debugger appears to work to a point, as there are some values in the Disassembly, Register, and Module tabs. Manually typing in continue will cause all that stuff to go away.
- Also tried typing in most of the gdb commands manually. This appeared successful until I had to type in continue.

4444:
- All attempts resulted in the debugger saying the thread was running, but nothing really shows up on the screen.

**If you type in the gdb commands manually, you might run into the error "rtosdemo.elf: No such file or directory." Simply type in "cd projects/freertos_ng/demo/arm7_lpc2106_gcc" and you should be good to go.

I have a feeling the issue is with the "thbreak main" command. I had a couple of errors while I was playing around regarding finding the breakpoint and main. This could possibly cause the debugger to hang at 10% when we run all the commands? Just a guess. This is an abbreviated post, as my original post got trashed by the blogger and now I'm all pissed.

I'll try to investigate the commands and stuff more when my brain is working again.

Debugger

  • Posted by: JSalomon • 14 February, 2008
So I installed yagarto eclipse on my laptop based on Sam7 cross dev rev C as per Dien's suggestion. If you feel the need to do the same, you only need the yagarto files. The debugger settings are also different, refer to Revision 3 for the 2106 settings.

Anyways, I got the project built, flashed (had to make minor change in the .script since the Eclipse build is newer:
(old) flash bank lpc2000 0x0 0x40000 0 0 lpc2000_v1 0 11059 calc_checksum
(new) flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v1 11059 calc_checksum
), and I tried running the debugger. I was getting a javascript error.

Dien said his debugger worked so he should try and bring his laptop in to check if it does.

More work on FreeRTOS

  • Posted by: JSalomon • 11 February, 2008
2368 demo

Tried to:
Double-check the PLL initialization in prvSetupHardware. I used the 2106 port as reference since its processor clock is the same (60Mhz).
Readded the demo tasks in main.c, they're commented.
Changed configTOTAL_HEAP_SIZE to (14 * 1024 ) keeping it below the amt of ram we have. However, as quoted from the FreeRtos site, this is only used if the task uses one of the heap_x.c files.

One value that we need to find is the xtal frequency. This is the on-chip crystal oscillator which is multiplied by the mainPLL_MUL (main.c). xtal * mainPLL_MUL should equal roughly 60MHz.



Some links

  • Posted by: JSalomon • 08 February, 2008
Newbie question

Phytec faqs

IAP

Initializing lpc2000 family

lpc22xx extermem Example code for using external memory. Probably good for reference as I think Kerry said there's something messed up with the chip and external mem.

Sam 7 Code

  • Posted by: ENg • 06 February, 2008
sam7 project code

more progress on 2368 Eclipse

  • Posted by: DNguyen • 05 February, 2008
Worked on the 2368 Port. I was able to succesfully remove all web server, Ethernet and TCP/IP stack code leaving the project with just a bare minimum code. also changed the code to run from flash( thanks Evan) by changing the linker script. im writing this at home but i'll upload the code later tonight or tomorrow and will name the project FreeRTOS_2368

Gotta change the 23xx.h file to 22xx, it's causing a lot of error right now. and modify prvSetupHardware to reflect the 22xx header file.

hw init

No wayyyy

  • Posted by: ENg • 05 February, 2008
In the words of Kerry Johnson, "I fixed the flash issue."

Changed the ram sizes in both linker scripts to 16K. Was able to resolve the "region ram is full" errors by linking the .bss section to flash. (If you look at lpc2106-rom.ld, all the portions under SECTIONS now end with ">flash") It used to be set to >ram, but it was clearly too big for the 16K ram and was therefore causing the errors.

Compiled using rom_thumb.bat, compiled fine. Ran OpenOCD rtos and rtosdemo.bin IS NOW WRITING. I tried flashing to both 0x0 and 0x00000200, both were successful. Ok, 0x0 wasn't perfect. Everything is overwritten except for the 6th word, which continues to display something like "e3e03007." I assume this is some kind of interrupt vector that cannot be overwritten, but I'm not sure at this point. To see up to the 6th word and stuff, use "mdw 0x0 8," with 8 being the number of words displayed starting at location 0x0.

I would suggest not changing the starting location of the flash memory location anymore. There is data, whether useful at this point or not, that starts from the first word at 0x0. If you want to write to a different location, change the last line of the flash script to reflect the desired address, ie. flash write 0 rtosdemo.bin 0x00000200.

With that all said, I didn't get a square wave or anything on the oscilloscope. To tell you the truth, I don't even know which hole is pin 30, though I tried all the bottom ones and got nothing. It's possible that since the program now starts at 0x00000200, the linker script or whatever doesn't know where to find it. I'm not sure about that right now. I also noticed that I don't see an include file in main.c for any kind of board. I added in FreeRTOSConfig.h which calls lpc210x.h, but I assume that has different pins than our board anyway.

One last thing. Line 283 in main.c states RUN_FROM_RAM, but when we compile with the bat file, one of the first lines says that the program is set to RUN_FROM_ROM. Not sure what kind of difference it'll make, but it's something to look at I think.

Trying

  • Posted by: JSalomon • 04 February, 2008
Worked with 2106 demo again (Ng)

Tried writing the program at an offset( flash write 0 rtosdemo.bin 0x00000200 ) , nothing showed up on the oscillator.

Also tried changing the following variables in partest.c:
#define partstFIRST_IO ( ( unsigned portLONG ) 0x400 )
#define partstNUM_LEDS ( 4 )
to something like
#define partstFIRST_IO ( ( unsigned portLONG ) 0x0 )
#define partstNUM_LEDS ( 30 )

to see if one port would get hit.
--
Also attempted to see if I could flash using the Philips Utility Loader. I tried to set up a virtual com port (sees usb as com) but for some reason it wouldn't detect it.
--
If I change the ram region to 16k, we get a ram section full error on compilation. I don't know how to address that; I'll do some research.

So I think the consensus is that we won't attempt to erase the first few addresses of flash bank 0. Instead we need to figure out how we can tell the linker where the main program is.

--
Trying this tomorrow

update

  • Posted by: DNguyen • 02 February, 2008
Okay, i was successfully able to compile a 2368 freertos demo on my laptop. i'll try to port the 2368 to our 2292 processor. i've ran into the region ram error when i changed from 32KB to 16 (the ram size for the 2292 is only 16KB from http://www.keil.com/dd/docs/datashts/philips/lpc2292_2294.pdf)

The flash bank is only 256KB and ram is 16KB. so guys go back to the freertos_ng and change the ram size to reflect that. also, the starting location of the flash is 0x000000. i'm going to change little bit by little bit band make sure it that compiles after each change.

looking at the lpc2292 documentation, the first 10byte starting from 0x00 is the boot block, interrupt vectors and is remapped from on-chip Flash memory to the upper memory block (0x7fffec001). to handle interrupts . so we can't erase those first blocks of memory.