I’M trying to get my first run with FreeRTOS on AVR chips.
I have an atmega328p, which is very similar to atmega323. I’m testing on the stk500v2 board.
According to the documentation, I’m making small changes in port.c, resume with a diff :
`diff ./Source/portable/GCC/ATMega323/port.c …
416c416
< ucLowByte = TIMSK;
> ucLowByte = TIMSK1;
418c418
< TIMSK = ucLowByte;
> TIMSK1 = ucLowByte;`
I see some errors in the test code due to serial port differences, so I change some ref :
`103c103
< ucByte = UCSRB;
> ucByte = UCSR0B;
105c105
< UCSRB = ucByte;
> UCSR0B = ucByte;
113c113
< ucInByte = UCSRB;
> ucInByte = UCSR0B;
115c115
< UCSRB = ucInByte;
> UCSR0B = ucInByte;
136c136
< UBRRL = ucByte;
> UBRR0L = ucByte;
140c140
< UBRRH = ucByte;
> UBRR0H = ucByte;
144c144
< UCSRB = ( serRX_INT_ENABLE | serRX_ENABLE | serTX_ENABLE );
> UCSR0B = ( serRX_INT_ENABLE | serRX_ENABLE | serTX_ENABLE );
147c147
< UCSRC = ( serUCSRC_SELECT | serEIGHT_DATA_BITS );
> UCSR0C = ( serUCSRC_SELECT | serEIGHT_DATA_BITS );
206c206
< ucByte = UCSRB;
> ucByte = UCSR0B;
208c208
< UCSRB = ucByte;
> UCSR0B = ucByte;
222c222
< cChar = UDR;
> cChar = UDR0;
240c240
< UDR = cChar;
> UDR0 = cChar;`
After that, I can compile the demo :
`Size after:
rtosdemo.elf :
section size addr
.data 80 8388864
.text 9880 0
.bss 1665 8388944
.stab 32016 0
.stabstr 15741 0
Total 59382
Errors: none
----- end -----`
But after uploading the code, It doesn’t work… no led flashing or signal on serial port.
Does anyone experiencing such problem? I don’t see what other difference between m323/3328 I have to code.
Sorry for the post I’m not good with the post language.
At the end, the port.c and serial.c mod to compile the demo for atmega328.
When I re-start after program the chip, nothing is happend, no led flashing, no data on serial spare port…
Sorry for the post I’m not good with the post language.
At the end, the port.c and serial.c mod to compile the demo for atmega328.
When I re-start after program the chip, nothing is happend, no led flashing, no data on serial spare port…
I just try with an another AVR, atmega32. I just change the makefile parameters, and it works (3 blinking leds + 2 serial port transmission leds) ! So I can exclude a problem on the stk500 and harware config.
I recheck the atmega328 spec, but I don’t fine where the problem come from.
That’s right, the interrupt comparator enable bit is not the same. And the interrupt vector name is not same. The final "port.c" is here. There is also problems with the serial port, but with the relevant tasks commented in main.c, it works.