How to build AVR32 example under Atmel Studio 7

anb80 wrote on Tuesday, May 17, 2016:

I have downloaded FreeRTOS 9.0.0 rc2 because I need to work with the latest FreeRTOS while Atmel ASF only provides FreeRTOS v.7.
However, it’s unclear to me how should I build the samples provided with the FreeRTOS download under Atmel Studio. I only get folder with main.c and other folders that contain AVR32 specific files.
Unfortunately I don’t know how to build this under Atmel Studio and also how to link it with FreeRTOS sources which are in completely different directory and have no relation to demo sources.

Thanks for help.

heinbali01 wrote on Wednesday, May 18, 2016:

AVR32 : is this a project with the UC3?

What version of Atmel Studio are you using?

What I would do is select a FreeRTOS V7 demo project. Also you select other features from the ASF that you need.
Compile and test it on your hardware.

When this basic demo project works, you can replace the kernel with 9.0.0 rc2, and gradually make it your own project. Let us know if it helps.

anb80 wrote on Wednesday, May 18, 2016:

Thanks, Hein,
yes, I am working with UC3.
What you suggest is the what I have tried multiple times last year with FreeRTOS v8 and now for the new project I am trying the same thinkg with v9. However, I am getting countless compile errors which I am trying to fix one by one, but every time I am close to zero, the build process seems to progress one step further and I get even more compile errors then. Therefore I don’t see any way how to get rid of all the errors.

rtel wrote on Wednesday, May 18, 2016:

Note the UC3 files in the FreeRTOS download are for old ES parts so the
port layer should come from the ASF.

anb80 wrote on Wednesday, May 18, 2016:

By “port” here do you mean port.c+portmacro.h+exception.S files from Source\Portable\GCC\AVR32_UC3 or gpio.c + gpio.h from Demos - DRIVERS?

rtel wrote on Wednesday, May 18, 2016:

The files in FreeRTOS/Source/portable/[compiler]/AVR32_UC3

anb80 wrote on Wednesday, May 18, 2016:

Is there any paid support or a person I can pay directly that would do this for me? I am spending too much time upgrading FreeRTOS v7 to v9 in Atmel Studio 7 project instead of doing the development.
I need to have a modified sample of basic FreeRTOS sample from Atmel Studio 7 with FreeRTOS v9 instead of v7…will give it another couple of tries today, but I am willing to pay someone if I have to lose more time than that.

heinbali01 wrote on Wednesday, May 18, 2016:

I don’t mind looking at the compiler output and give some hints.

If you want, email me directly to h point tibosch at freertos point org and we’ll get through it after a few emails. I’m not unfamiliar with the UC3A0512.

In return, I would appreciate if you put your DEMO project available for other users.

Regards.

anb80 wrote on Thursday, May 19, 2016:

I am not sure I can really preserve the e.g. portmacro.h from the FreeRTOS/Source/portable/[compiler]/AVR32_UC3 folder of the Atmel ASF because then I am completely missing the BaseType_t definition which is defined in FreeRTOS v9 sources in portmacro.h as:
typedef long BaseType_t;

Are you sure in that case I must preserve all files from FreeRTOS/Source/portable/[compiler]/AVR32_UC3 folder created by Atmel Studio?

heycki wrote on Sunday, November 27, 2016:

Hi, sorry to revive an old thread but the problem in question persist.

I’m also working with AVR32 UC3C and there’s no problem building FreeRTOS v7 provided by ASF.

Building v9 is impossible, though, because the Atmel Framework doesn’t even have the header files (sys/cpu.h, sys/usart.h) referenced from FreeRTOS/portable/GCC/AVR32/AVR32_UC3/port.c.

Have you found any solution to this?

Using AVR32 Toolchain 3.4.3.

heinbali01 wrote on Monday, November 28, 2016:

I tried both toolchains :

	avr32-gcc (AVR_32_bit_GNU_Toolchain_3.4.3_820) 4.4.7
    avr32-gcc (AVR_32_bit_GNU_Toolchain_3.4.2_435) 4.4.7

Both had a few missing defines in some avr32 header files:

AVR32_INTC_IPR0_INTLEV_SIZE
AVR32_INTC_IPR0_INTLEV_MASK
AVR32_INTC_IPR0_INTLEV_OFFSET
AVR32_PWM_PWM_[0-3]_FUNCTION
AVR32_USART0_RXD_0_PIN
AVR32_USART0_RXD_0_FUNCTION
AVR32_USART0_TXD_0_PIN
AVR32_USART0_TXD_0_FUNCTION
AVR32_USART1_RXD_0_PIN
AVR32_USART1_RXD_0_FUNCTION
AVR32_USART1_TXD_0_PIN
AVR32_USART1_TXD_0_FUNCTION

which were easy to add.

After that I saw linker errors:

    port.c(1,1): error: undefined reference to `set_cpu_hz'
    port.c(1,1): error: undefined reference to `set_usart_base'
    port.c(1,1): error: undefined reference to `usart_init'

set_cpu_hz() has to do with Newlib and functions like udelay().

Do you plan to use a usart?

I can not find a function that matches the call usart_init( configDBG_USART_BAUDRATE ).

When the ASF Wizard (in AS-7) creates usart-support I get this module:

    src\ASF\avr32\drivers\usart\usart[.ch]

with this function:

    extern int usart_init_rs232(volatile avr32_usart_t *usart, const usart_options_t *opt, long pba_hz);

That is how far I got with this demo project. Maybe some else knows where usart_init( BaudRate ) is defined.

Regards.