SAM e70/v71 freertos +tcp +fat

Go To Last Post
8 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

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

Hi, I am trying to bring this old story back to life.

 

I am using files from ASF 3.40, FreeRTOS v10.1.1 and using the solution in this tread. But it does not work. I don't find any documentation on the FreeRTOS+TCP. Yes, it has a guide, but, it does not tell anything about how tasks and interrupts work together etc.

 

In addition to the call to FreeRTOS_IPInit() in main, I have the clock to the GMAC enabled just before. Anything more I need? Where and how do I start debugging, when I have no idea how it is meant to work?

 

xNetworkUp = 1, xNetworkAddressing holds the IP, netmask and gataway I have set up. Furthermore the DHCP is enabled. But I see absolutely no activity in wireshark and ping does not work.

 

PS: I have tried the ASF ping server demo project, and that works, therefore HW, switch, wireshark all working. By the way, I am running at the SAM E70 xplained kit.

 

PPS: I am implementing this in the blinking demo, where two tasks blink an LED, this is working.

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

Hello, I'm trying to implement the FreeRTOS+TCP/IP stack on SAMV71Q21B Evaluation board using MPLAB X IDE. I came across the networkinterface.c on the following repository:  https://github.com/jtbr/FreeRTOS-TCP_SAMV71_NetIntf

This looks perfect for the board, but when I include it in the project, it gives several errors related to the Gmac structure and a few includes. These can be seen in the attached image

 

Does anyone have any clue as to what might be wrong here? Could it be related to the IDE? I'm aware that the NetworkInterfaces file in the above repo was developed by taking into account the ASF environment. Any help would be greatly appreciated. Thanks!

Attachment(s): 

Last Edited: Fri. Jul 30, 2021 - 11:36 AM