MSP430 IAR / FreeRTOS v4.0.1 Update. This update contains the entire FreeRTOS v4.0.1 distribution with the additions/modifications needed to support the zxWORKBENCH Microcontroller Development Kit with the MSP430F1XX Microcontroller Board. The builds that are contained in this zipfile are made with the latest EW430 release available from IAR - that's version 3.41A as of this writing. zxWORKBENCH and Microcontroller connections: Microcontroller/Mainboard Connections: Power: J40(Mainboard) - In ENabled position. LED's: J6(P4[0-7]) connected to J10(Mainboard) observing orientation. UART: UART1 connected to RS232 #1 - P3.6 to P5 of J6(Mainboard), P3.7 to P3 of J6(Mainboard). Micontroller Board Jumpers: Power Config: J1: VREF=-GND : 1-2 VREF+=MDVCC : 5-6 MAVCC=MDVCC : 9-10 MDVCC=DVCC : 15-16 Please see board_jumper_settings.jpg posted to my web-site for clarification. This file has been updated to reflect anything new per the zxWORKBENCH Microcontroller Development Kit from zxTechnologies. The microcontroller board that I have has been installed with an MSP430F1611. I've noted items in the code - like in ..\main.c that you'll need to change - like memory sizes, etc. to use a different microcontroller like the '169. The *.txt files are found in ..\Debug\Exe\... You can load the *.txt files onto the board and observe LED's 0-3 (Dual-LED's) blinking according to the default LED task 'pattern' and ASCII 'A' thru 'z' will print out of the RS232 #1 (DTE-PC) serial port @ 115.2KB, 8 bits, 1 stop-bit, no parity. Note you'll need a NULL modem cable connected to the serial port of the board. A NULL modem cable is a cable that crosses pins 2 and 3. A straight-through cable won't work - you won't see anything printing out unless you attach a NULL modem adapter or NULL modem cable. Alternately, you can cross the connection wires coming from port 3 of the microcontroller board to the RS-232 port. Notes: This file is just here as a suggestion on how to get going - plus gives a 'state of the port' - please read under prvSetupHardware() and port.c below as a minimum: Files to modify for your target: ..\Demo\msp430_iar: take a look at main.c: - (also, in case you're porting to another target - these are good hints:) mainly prvSetupHardware(): clocking and I/O's are set-up there - VERY important! You must first change prvSetupHardware() to match your target. There's a lot of example I/O setup there - you may damage your target if you don't match the I/O to your target. FreeRTOSConfig.h - configCPU_CLOCK_HZ - default here is (6MHz For The zxWORKBENCH Microcontroller Board) 8MHz FreeRTOSConfig_asm.h - copy of the above to be included in assembler file (below). in main() - put in what you want to try and run - but look at the functions first. I have commented out vStartLEDFlashTasks() because my target doesn't match that... (the zxWORKBENCH Mainboard has LEDs 0-3 as mentioned above - so it is included - you can customize as you wish) In main() - 34 tasks are started - at this point I think all of them are running OK - you can monitor the usTaskCheck[] array and you should see all of the counters increment - indicating that pvParameters must be working OK. You can also monitor sBlockingProducerCount[] and sBlockingConsumerCount[]. For a '169 target for instance, you can see comments in main.c to only run these: - the LED tasks are started - since there are only 4 - that's 4 for them (memory). The COM tasks are started - that's two more, plus an error check task plus the IDLE task for a total of 8 tasks. You can experiment with the other tasks - that's what I used for the '169. If you recompile as is - the '1611 will be chosen as the target and will include the 34 tasks. You'll need to edit main.c as needed for your target since you'll run out of stack space on the '169 if you try to run 34 tasks... This port was done with the MSP430F1611 in mind - you'll want to take a look at: FreeRTOS\Source\portable\msp430f1611: (the port uses this even if you build for the '169 - you can change that in the compile options) interrupt_grabber.c - just a debug file that will 'grab' - spin (while (1)) if an unexpected interrupt is generated by your target. Just edit this as needed. If you get INTVEC 'collisions' at link time - more than likely you need to edit this file. Lowinit.c - included with the IAR Compiler - helps to initialize unused areas in memory - helpful in finding that pointer marching through memory - in the workspace I've defined this as (FF3F) - JMP HERE.... port.c - take a look and modify as needed. This is where the issue exists with R12 copying pvParameters into R10 - I've tried to fix this in this port but I won't 100% guarantee it'll work in all cases. There are some instances of data types in which this may not work with the IAR compiler - at least that's my current understanding. AFAIK though - this is working OK. portext.s43 - MSP430 file with context save/restore macros and what's necessary for the timer tick. I basically cloned the MSPGCC and xWorks ports as a starting point obviously. portmacro.h - take a look and modify as (or if) needed. This port uses the serial.c file in the xWorks port (modified): ..\Demo\msp430_Crossworks\serial\serial.c: take a look at that and modify as needed. This port also uses the ParTest.c file in the xWorks port (modified also): ..\Demo\msp430_Crossworks\ParTest\ParTest.c: take a look at that and modify as needed. portable.h: ..\Source\include\portable.h: IAR_MSP430 is defined there. It's also a C preprocessing #define... You'll need to modify this as needed. This port is supplied as is and is posted as a 'public service'. If you have questions I'll be happy to attempt to help; but you'll probably be better served by looking at www.FreeRTOS.org or asking Richard Barry. You can post a question at http://www.sourceforge.net/projects/freertos/ look for Forums on the toolbar and post there. It's also useful to search the forum archives because the issue you may be having has happened to someone before and you'll be able to benefit from their prior experience by reading the forum threads. As a reminder: FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Have Fun, John C. Westmoreland April '06