четверг, 27 октября 2011 г.

LM3S9B92 and FreeRTOS example

Usual all developers starts with example of Web-server on FreeRTOS for this board. But always it does not work: Ethernet link is lost. How to cure it?

First, download last version of FreeRTOS (I tryed FreeRTOSv7.0.2.exe archive). Then unpack it. You can cut unnecessary folders from Demo folder: all except "Common" and "CORTEX_LM3Sxxxx_Eclipse".

Then download Yagarto GNU toolchain (I used yagarto-bu-2.21_gcc-4.6.0-c-c++_nl-1.19.0_gdb-7.2_eabi_20110429) and install it.

Then open main.c in "Demo\CORTEX_LM3Sxxxx_Eclipse\RTOSDemo" and change prvSetupHardware() function to:
void prvSetupHardware(void)
{
 SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
 SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
 GPIODirModeSet(GPIO_PORTF_BASE, (GPIO_PIN_2 | GPIO_PIN_3), GPIO_DIR_MODE_HW);
 GPIOPadConfigSet(GPIO_PORTF_BASE, (GPIO_PIN_2 | GPIO_PIN_3 ), GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
 vParTestInitialise();
}
After it call make in console (Makefile is near main.c :). And now program RTOSDemo.bin into your chip with LM Flash Programmer tool. MAC address of the device should be set. Now reboot MCU and try to ping it - default IP address is 172.25.218.19. You can set static IP of your PC to 172.25.218.10/255.255.0.0 for this reason. And don't forget to disconnect your WiFi :)

There are pong packets! Now try to open in the Web browser http://172.25.218.19 - page will be refresh after 1 second and tasks will be shown.
Thanks to and it's help here.

Комментариев нет:

Отправить комментарий

Thanks for your posting!