Arduino Forum

Development => Other Software Development => Topic started by: ptrnull on May 29, 2020, 05:06 am

Title: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on May 29, 2020, 05:06 am
Hello everyone,

I am Zhihong Niu, a 2nd year computer science student from China. I am one of the two students selected by Arduino for this year's Google Summer of Code, you can find the other student here (https://forum.arduino.cc/index.php?topic=685221.msg4619717#new).

You can find my proposal here (https://github.com/gsoc-cn/gsoc-cn/blob/master/resources/arduino/proposals/2020/PortFreeRTOS2Portenta.pdf). This is an organization which made up of previous GSoC students who would like to share their experience of applying and passing GSoC. If you find members here interned for the organization(s) you want to apply for this year, feel free to contact them.

This summer I will port FreeRTOS to the new board Portenta H7 (https://store.arduino.cc/usa/portenta-h7), and try to allow running arduino sketches on it.

Between June 2, 2020 and September 1, 2020 I will post my weekly report  here, if it can help some people, that would be great.

Any questions are welcome.

Thank you :smiley-lol:
Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Jun 09, 2020, 05:11 am
# GSoC 2020 1st Week Report

__Arduino: Port FreeRTOS to Portenta H7__, __Zhihong Niu__

## Major Progress

- Familiar with Portenta H7 development workflow.
- Obtain the necessary information about Portenta from mentors.
- Build development environment.

## Work Completed

- Refer to ArduinoCore-mbed to build development environment

   By observing the compilation output of the Arduino IDE, a preliminary Makefile environment is built.

- Improve work plan

   Two sets of schemes are summarized: 1. Gradually add code based on the built Makefile framework, and finally complete the project; 2. Refer to the structure of ArduinoCore-mbed and gradually replace it. Will choose to use according to the actual situation.

## Deficiencies

- The work is not expected to be complicated enough and not fully prepared.
- Unfamiliar with Arduino tools, spent a lot of time familiarizing.

## Plan

- Continue to build the environment.
- Continue to improve the work plan.
- Carry out preliminary tests after the completion of environmental construction and work plan.
Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Jun 16, 2020, 06:08 am
# GSoC 2020 2nd Week Report

__Arduino: Port FreeRTOS to Portenta H7__, __Zhihong Niu__

## Major Progress

- Improve Makefile
- Working on porting FreeRTOS

## Work Completed

- Initial porting of FreeRTOS

## Deficiencies

- Encountered difficulties in the link script.

## Plan

- Figure out the principle of the link script
- Complete FreeRTOS porting

Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: pert on Jun 16, 2020, 04:22 pm
Hi Zhihong Niu. It sounds like you're making some good progress. Is this the repository where we can follow your work?:
https://github.com/MRNIU/FreeRTOS-PortentaH7 (https://github.com/MRNIU/FreeRTOS-PortentaH7)
Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Jun 17, 2020, 04:27 pm
Hi Zhihong Niu. It sounds like you're making some good progress. Is this the repository where we can follow your work?:
https://github.com/MRNIU/FreeRTOS-PortentaH7 (https://github.com/MRNIU/FreeRTOS-PortentaH7)
Yes it is. Any suggestions are welcome.
Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Jun 23, 2020, 05:51 am
# GSoC 2020 3rd Week Report

__Arduino: Port FreeRTOS to Portenta H7__, __Zhihong Niu__

## Major Progress

- FreeRTOS almost there.

## Work Completed

- FreeRTOS now available on Portenta theoretical, need test.

## Deficiencies

- Some mistake on upload, resolved.

## Plan

- Test
- Begin port ArduinoCore.
Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Jun 30, 2020, 02:54 pm
# GSoC 2020 4th Week Report

__Arduino: Port FreeRTOS to Portenta H7__, __Zhihong Niu__

## Major Progress

- Debug

## Work Completed

- Try to test the code, but there are some problems at hardware initialization, its difficult for me.
- Basic code for ArduinoCore-freertos, some details need to discuss.

## Deficiencies

- Not understand what happened during the hardware initialization, what functions do I need to call to be correct? I am working hard on it.

## Plan

- Test
- Begin port ArduinoCore code.

Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Jul 06, 2020, 09:34 pm
# GSoC 2020 5th Week Report

__Arduino: Port FreeRTOS to Portenta H7__, __Zhihong Niu__

## Major Progress

- Running FreeRTOS on Portenta H7 successful.

## Work Completed

- Run FreeRTOS on Portenta H7, testing is under way.

## Deficiencies

- Some bug in hardware init and task scheduler.

## Plan

- Fix known bugs.
- Write ArduinoCore-freertos.
- Add comments makes it easy for people to know where I am having trouble, and how was it solved.

Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Jul 14, 2020, 09:16 am
# GSoC 2020 6th Week Report

__Arduino: Port FreeRTOS to Portenta H7__, __Zhihong Niu__

## Major Progress

- Write dev log.
- Studied the implementation of mbed.
- The overall scheme for ArduinoCore-freertos has been completed.

## Work Completed

- The overall scheme for ArduinoCore-freertos.

## Deficiencies

- Because I was not familiar with mbed, I made a wrong plan at the beginning, but fortunately I corrected it in time later.

## Plan

- Realize the transformation between Arduino and STM32_HAL.
Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Jul 22, 2020, 03:02 am
# GSoC 2020 7th Week Report

__Arduino: Port FreeRTOS to Portenta H7__, __Zhihong Niu__

## Major Progress

- Working on gpio operation.

## Work Completed

- Implementation of some top-level functions, and the gpio operation almost done.

## Deficiencies

- The definition of the pin between Arduino and STM32 puzzled me for a while. Fortunately, the implementation of mbed helped me solve this problem.

## Plan

- Finish gpio operation.

Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Jul 29, 2020, 06:06 am
# GSoC 2020 8th Week Report

__Arduino: Port FreeRTOS to Portenta H7__, __Zhihong Niu__

## Major Progress

- Find out a useful repo: Arduino_Core_STM32, I'm reading its code.

## Work Completed

- Checkout a new branch `stm32`, I wanna combine Arduino_Core_STM32 and ArduinoCore-mbed.

## Deficiencies

- The past week has gone well.

## Plan

- Complete the code based on Arduino_Core_STM32 and ArduinoCore-mbed.

Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Aug 05, 2020, 12:48 pm
# GSoC 2020 9th Week Report

__Arduino: Port FreeRTOS to Portenta H7__, __Zhihong Niu__

## Major Progress

- Working on add new variant for Arduino_Core_STM32

## Work Completed

- Learning how to use platform.txt and boards.txt

## Deficiencies

- No questions here.

## Plan

- Add PORTENTA H7 for Arduino_Core_STM32, maybe a PR for that.

Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Aug 14, 2020, 03:36 pm
# GSoC 2020 10th Week Report

__Arduino: Port FreeRTOS to Portenta H7__, __Zhihong Niu__

## Major Progress

- Successfully compiled code with the Arduino IDE.

## Work Completed

- Now you can compile the code with Arduino IDE.

## Deficiencies

- Although it can compile, the response is not visible on the hardware.

## Plan

- Add FreeRTOS support.
- Fix bug.
Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Aug 20, 2020, 12:57 pm
# GSoC 2020 11th Week Report

__Arduino: Port FreeRTOS to Portenta H7__, __Zhihong Niu__

## Major Progress

- ArduinoCore-freertos almost there.

## Work Completed

- Handle details, finish the stm32 branch.

## Deficiencies

- LED flash after upload, do not know what is the meaning

## Plan

- Fix bug.
- Clean up code style.
Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: pert on Aug 20, 2020, 01:02 pm
- LED flash after upload, do not know what is the meaning
Is it the 4X long, 4X short blink pattern?
Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Aug 26, 2020, 05:41 pm
Is it the 4X long, 4X short blink pattern?
Yes, my mentor tell me it means Mbed OS has crashed. I have already fixed this mistake.
Thank you.
Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: pert on Aug 26, 2020, 05:58 pm
I'm glad to hear it! That was actually me chatting with you about this subject on Arduino's Slack also.
Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Aug 27, 2020, 05:13 pm
I'm glad to hear it! That was actually me chatting with you about this subject on Arduino's Slack also.
What a surprise! Thanks for your help!
Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Aug 27, 2020, 05:20 pm
# GSoC 2020 12th Week Report

__Arduino: Port FreeRTOS to Portenta H7__, __Zhihong Niu__

## Major Progress

- Debug.

## Work Completed

- Fix the bug I mentioned last week.

## Deficiencies

- New bugs are coming.

## Plan

- Fix bug.
- Apply my ideas to the AVR platform.
- Prepare the materials to be submitted to GSoC.
Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Sep 03, 2020, 03:44 pm
# GSoC 2020 13th Week Report

__Arduino: Port FreeRTOS to Portenta H7__, __Zhihong Niu__

## Major Progress

- Now FreeRTOS is available on Arduino UNO

## Work Completed

- Test FreeRTOS on Arduino UNO

## Deficiencies

- None

## Plan

- Fix bug.
- Support more boards
Title: Re: [GSoC 2020] Port FreeRTOS to Portenta
Post by: ptrnull on Sep 16, 2020, 03:06 pm
# GSoC 2020 Final Report

__Arduino: Port FreeRTOS to Portenta H7__, __Zhihong Niu__

I am honored to be part of the Arduino community, GSoC 2020 is over, but there are still imperfections in my work, I will working on that in my [repo](https://github.com/MRNIU/ArduinoCore-freertos), and will not continue to post here.

Thank you Arduino community!