SAM e70/v71 freertos +tcp +fat

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

i already posted this at another forum, but a mod told me to post it here again. Sry for that.

 

Hi guys,

I am using the "SAM E70 Xplained" board and ATMEL Studio 7.

I already implemented a lot of different projects without Freertos. (sd card, uart, ethernet, can,....).

 

My latest project idea was to transfer a file via ftp server to my microcontroller and save this file on my sd card plugged in to my sam e70 eva board.

First of all I  compiled the given "Freertos Basic Example" from the atmel framework and let it run on my board.

It worked fine and  I understood how freertos is working.

 

On my next step I found a project for the sam4 board (http://www.freertos.org/FreeRTOS...) and I wanted to realzie it on my sam e70 board.

 

I downloaded an example file from  http://www.freertos.org/FreeRTOS... (freerrtos-Plus/Demo/FreeRTOS_Plus_TCP_and_FAT_ATSAM4E/RtosDemo.atsln) and compiled it successfully in atmel studio for sam4e.

 

Next step would be to port the project from sam4e to sam e70.

 

I created an empty GCC C ASF Board project for sam e70 and imported via ASF wizard the FreeRtos mini kernel module.

 

 

The key point is that the "modules""FreeRtos-PlusCLI","FreeRtos-PlusFAT" and "FreeRtos-PlusTCP" could not be included via asf wizard.

 

So the question is: Whats the best way to "import" these FreeRtos Plus functions to my new project.

 

I hope you get my problem and it would be really nice if you can help me.

 

Best Felix

 

 

(sry for my bad english)

This topic has a solution.
Last Edited: Thu. Oct 26, 2017 - 09:38 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am now started to port the sam4e example project to sam e70
I found at that there is no existing porting for FreeRTOS+TCP so I´m  trying to do this by my own.... but I have some problems to port the network interface

 

if somebody out there already did a simular porting to sam e70, it would be very nice if he can share his project to me

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Finally it works:

Thanks to Justin, who published his networkinterface.c https://github.com/jtbr/FreeRTOS-TCP_SAMV71_NetIntf

requirements:

Best Felix

 

EDIT:

  • I had to set compiler optimitaztion level to None (-O0) (right now I have no idea why)
  • at the beginning I had some issues with the system clock
          => Processor Clock (HCLK) runs with 300MHz
          => Master Clock (MCK) runs with 80MHz => MCK is needed for "ethernet clock"
          => MCK should not excedd 240MHz => see IEEE 802.11
 

 

 

Last Edited: Thu. Oct 26, 2017 - 09:15 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a similar problem using GMAC with DMA but I am on FreeRTOS with lwip 1.4.1 tcp. I'd like to know if your solution works with cache enabled. Also I noticed that optimization enabled can have drawbacks. Can you give more infos regarding the GMAC clock ? It should work up to 240MHz but you must use 80MHz ?

SAME newbie

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

my clock configs:

#define CONFIG_SYSCLK_SOURCE        SYSCLK_SRC_PLLACK

#define CONFIG_SYSCLK_PRES          SYSCLK_PRES_1

#define CONFIG_SYSCLK_DIV           4

// ===== PLL0 (A) Options   (Fpll = (Fclk * PLL_mul) / PLL_div)
// Use mul and div effective values here.
#define CONFIG_PLL0_SOURCE          PLL_SRC_MAINCK_XTAL
#define CONFIG_PLL0_MUL             25
#define CONFIG_PLL0_DIV             1

=> Processor Clock (HCLK) runs with 300MHz
=> Master Clock (MCK) runs with 80MHz

 

sry for my incomprehensible phrasing:

the ethernet component has a divider, which divides your MCK Clock speed  and generates the Management Data Clock (MDC)

=> MDC must no exceed 2.5 MHZ

so in my case i have to divide MCK clock speed by 32 to reach 2.5 MHz for  MDC clock speed

this could be configured in the GMAC_NCFGR register (data sheet page 745 for same70)

to summarize it: you can use differnt MCK clock speeds, but then you have to divide your MCK  like its is described in the table above

i hope i could help

Best Felix

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the fast reply. Also I'd like to know if you have #define CONF_BOARD_ENABLE_CACHE e.g. in your conf_board.h set. If so, have you excluded the DMA buffers as mentioned in your posts above ?

SAME newbie