Commit Graph

3057 Commits (57530af294f6b1a8228e4e719871c6bea07ee5b0)
 

Author SHA1 Message Date
magicse7en 82df39764a
Xtensa: fix the coproc_area incorrect issue (#117)
* Xtensa: fix the coproc_area incorrect issue

foss-xtensa/amazon-freertos#2 mentioned a issue:
1.
In function pxPortInitialiseStack(StackType_t *pxTopOfStack....)
p = (uint32_t *)(((uint32_t) pxTopOfStack - XT_CP_SIZE) & ~0xf);

In function prvInitialiseNewTask (file: task.c)
pxTopOfStack = (pxStack + (ulStackDepth - 1)) & (~portBYTE_ALIGNMENT_MASK)

So the co-processor area is at
p = (uint32_t *)(((uint32_t)((pxStack + (ulStackDepth - 1)) & (~portBYTE_ALIGNMENT_MASK)) - XT_CP_SIZE) & ~0xf);

2.
In function vPortStoreTaskMPUSettings( .... , StackType_t pxBottomOfStack ...)
xMPUSettings->coproc_area = (StackType_t)((((uint32_t)(pxBottomOfStack + usStackDepth - 1)) - XT_CP_SIZE) & ~0xf);

pxBottomOfStack = pxStack

=> xMPUSettings->coproc_area = (StackType_t*)((((uint32_t)(pxStack+ ulStackDepth - 1)) - XT_CP_SIZE ) & ~0xf);

The p is coproc_area that should be equal to xMPUSettings->coproc_area.

For example, assume pxStack is 0xa0000000, ulStackDepth is 0x2000,
portBYTE_ALIGNMENT_MASK is 0x7f, XT_CP_SIZE is 0x100.

The p = (uint32_t)(((uint32_t)((pxStack + (ulStackDepth - 1)) & (~portBYTE_ALIGNMENT_MASK)) - XT_CP_SIZE) & ~0xf)
      = 0xa0001e80
The xMPUSettings->coproc_area = (StackType_t)((((uint32_t)(pxStack+ usStackDepth - 1)) - XT_CP_SIZE ) & ~0xf)
                              = 0xa0001ef0
Obviously, the p is not equal to the xMPUSettings->coproc_area, which will cause context switching error.

Signed-off-by: magicse7en <magicse7en@outlook.com>

* Update port.c

Co-authored-by: Carl Lundin <53273776+lundinc2@users.noreply.github.com>
4 years ago
magicse7en b9748e50ea
Xtensa: fix stack overlap coproc_area issue (#118)
In function pxPortInitialiseStack of port.c:
	sp = ( StackType_t * ) ( ( ( UBaseType_t ) ( pxTopOfStack + 1 )  - XT_CP_SIZE - XT_STK_FRMSZ ) & ~0xf );
We assume XT_CP_SIZE is 0xE4, XT_STK_FRMSZ is 0xA0, pxTopOfStack is 0xA0000000, sp is 0x9FFFFE80.
From port.c, we know the frame->a1 as below:
	frame->a1 = ( UBaseType_t ) sp + XT_STK_FRMSZ;  /* physical top of stack frame    */
So frame->a1 is 0x9FFFFF20. Therefore the interrupt stack frame range is 0x9FFFFE80 ~ 0x9FFFFF20.

The coproc_area is: p = ( uint32_t * ) ( ( ( uint32_t ) pxTopOfStack - XT_CP_SIZE ) & ~0xf );
So its value is 0x9FFFFF10. Obviously, the interrupt stack frame overlaps the coproc_area.

Co-authored-by: Carl Lundin <53273776+lundinc2@users.noreply.github.com>
4 years ago
alfred gedeon f376c3bd71
Fix: Pass lexicon.txt as a parameter (#208)
* Fix: pass lexicon.txt as a parameter

* Fix lexicon location
4 years ago
Gaurav-Aggarwal-AWS db62e30bce
Fix missed yield in xTaskResumeFromISR (#207)
If a higher priority task than the currently running task was resumed
using xTaskResumeFromISR and the user chose to ignore the return value
of xTaskResumeFromISR to initiate a context switch using
portYIELD_FROM_ISR, we were not doing the context switch on the next run
of the scheduler. This change fixes this by marking a yield as pending
to ensure that the context switch is performed on the next run of the
scheduler.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
4 years ago
alfred gedeon c6636f465f
Move markdown files and lexicon into .github directory (#205)
* Move markdown files and lexicon into .github directory
4 years ago
alfred gedeon f62dfa20c8
Fix: C++ compiler warning (#203) 4 years ago
RichardBarry 5fb26de019
Recently vTaskDelayUntil() was updated to xTaskDelayUntil() because the function now returns a value. The PR didn't make the same change in the MPU port, or update the constants required to include the xTaskDelayUntil() function in the build. (#199)
This PR:
Changes the INCLUDE_vTaskDelayUntil compile time constant to INCLUDE_xTaskDelayUntil.
Updates FreeRTOS.h to ensure backward compatibility for projects that already have INCLUDE_vTaskDelayUntil defined.
Updates the MPU prototypes, wrapper and implementation to use the updated xTaskDelayUntil() function.

Tests to be checked into the FreeRTOS/FreeRTOS repository after this PR.
4 years ago
RichardBarry 71be31bb61
xStreamBufferSend() caps the maximum amount of data a stream buffer can send to the maximum capacity of the buffer - however the value to which the length is capped was wrong, and is correct by this check in. Likewise when sending to a message buffer if the send length is too long the block time is set to 0 to ensure the sending task does not wait indefinitely for the impossible send to complete - but the length check was wrong, and is corrected by this check in. (#195) 4 years ago
RichardBarry 167ea16282
Minor updates to formatting and MISRA compliance of the PR used to update the vTaskDelayUntil() function to xTaskDelayUntil(). (#198) 4 years ago
Joseph Julicher 6375d52250
matching the preprocessor conditionals for xTaskGetCurrentTaskHandle() (#197) 4 years ago
Spacefish 3260e228c3
vTaskDelayUntil improvement (#77)
* vTaskDelayUntil improvement

* suggestions implemented

* xTaskDelayUntil #define added

* doc small fix

* small formatting stuff

* more small formatting stuff

* Update lexicon.txt

Co-authored-by: Carl Lundin <53273776+lundinc2@users.noreply.github.com>
Co-authored-by: Carl Lundin <lundinc@amazon.com>
4 years ago
Carl Lundin 3d4d17178f
Reintroduce Espressif's IDF v4.2 changes to ESP32 port (#193)
* Renamed old port to ESP_IDF_V3

* Update ESP32 port files to support IDF v4.2.

* Add changes required to support ESP32-S2

Co-authored-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>
4 years ago
Reda Maher 77ad717400
Posix: Fix no task switching issue if a task ended its main function (#184)
* Posix: Fix no task switching issue if a task ended

When the main function of a task exits, no task switching happened.
This is because all the remaining tasks are waiting on the condition
variable. The fix is to trigger a task switch and mark the exiting
task as "Dying" to be suspened and exited properly from the scheduler.

* Posix: Assert and stop if the Task function returned

* Posix: just assert if a task returned from its main function

Co-authored-by: alfred gedeon <alfred2g@hotmail.com>
4 years ago
RichardBarry fccb97b10b
No functional changes. (#194)
Shorted overly verbose and opinionated comments in xStreamBufferSend().
Remove the unnecessary xIsFeasible variable from xStreamBufferSend().
4 years ago
David Chalco b1307dbea8
OpenOCD Support: Re-introduce uxTopUsedPriority (#188)
* re-introduce uxTopUsedPriority. Prevent removal by optimization

* Make uxTopUsedPriority volatile to avoid optimizer + code comment

Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
4 years ago
Cobus van Eeden a4625fbd4d Update issue templates 4 years ago
Cobus van Eeden 3e9f748b55
Update issue templates (#191) 4 years ago
Cobus van Eeden f2be29dd8e
Create config.yml (#190) 4 years ago
Reda Maher baeb5af9a4
Posix: Free the allocated memory after deleting a task or ending the scheduler (#181)
* Posix: Free Idle task resources after ending the scheduler

In case of using Posix simulator and ending the scheduler, it does
not free the resources allocated by the idle task. This
causes the memory checkers (Valgrind, Address Sanitizers, ..) to
complain.

* Posix: Free the condition variable memory in the correct place

In case of deleting a task from another task, the deletion happens
immediately and the thread is canceled but the memory allocated by
the task condition variable is not freed. This causes the memory
checkers (Valgrind, Address sanitizers, ..) to complain.

* Posix: End Timer thread and free its resources after ending the scheduler
4 years ago
Gaurav-Aggarwal-AWS 2225bb5620
Fix Stack alignment for Microchip PIC32MX port (#182)
* Fix Stack alignment for Microchip PIC32MX port

The stack of a task was not 8 byte aligned. Adding one more unused space
at the beginning of task stack (before simulated context) ensures that
the stack is 8 byte aligned. The stack (with simulated context) of a
newly created task looks like the following:

                    +------------+
                    | UNUSED     |
                    +------------+
                    | UNUSED     |
                    +------------+
                    | 0xDEADBEEF |
                    +------------+
                    | 0x12345678 |
                ^   +------------+
                |   | CAUSE      | <-- SP After Context Restore
                |   +------------+
                |   | STATUS     |
                |   +------------+
                |   | EPC        |
                |   +------------+
                |   | ra         |
                |   +------------+
                |   | s8         |
                |   +------------+
                |   | t9         |
                |   +------------+
                |   | t8         |
                |   +------------+
                |   | t7         |
                |   +------------+
                |   | t6         |
                |   +------------+
                |   | t5         |
                |   +------------+
                |   | t4         |
                |   +------------+
                |   | t3         |
                |   +------------+
                |   | t2         |
                |   +------------+
                |   | t1         |
                |   +------------+
    Context     |   | t0         |
  (132 bytes)   |   +------------+
                |   | a3         |
                |   +------------+
                |   | a2         |
                |   +------------+
                |   | a1         |
                |   +------------+
                |   | a0         |
                |   +------------+
                |   | v1         |
                |   +------------+
                |   | v0         |
                |   +------------+
                |   | s7         |
                |   +------------+
                |   | s6         |
                |   +------------+
                |   | s5         |
                |   +------------+
                |   | s4         |
                |   +------------+
                |   | s3         |
                |   +------------+
                |   | s2         |
                |   +------------+
                |   | s1         |
                |   +------------+
                |   | s0         |
                |   +------------+
                |   | at         |
                |   +------------+
                |   | HI         |
                |   +------------+
                |   | LO         |
                |   +------------+
                V   |            |
                    +------------+
                    |            | <-- SP After Context Save
                    +------------+

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

* Update comment

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
4 years ago
NoMaY (a user of Japan.RenesasRulz.com) c3117b4237
Maintenance: Add readme.txt in each Renesas RX folder to show recommended port (#152)
* Maintenance: Add readme.txt in each Renesas RX folder to show recomended port
* Update readme.txt in each Renesas RX folder regarding to Notes *1 and *2 (both are RX100 port)
4 years ago
alfred gedeon f2d8f66ae3
Maintenance: Github workflow URL checker (#179)
* Remove non needed spell checks

* FreeRTOS Kernel Spelling Update (#170)

* FreeRTOS Kernel Spelling Update

* Added spell check to kernel repository.
* Fixed small spelling errors in various kernel source files.
* Added documentation for spellcheck.

Note: Only kernel files are checked for spelling, and portable files are ignored.

* Fix exit 0

* Remove spell

* add echo

* Call script from ci

* Fix script location

* Print pwd

* Fix script

* Fix script

* Remove some lines from script

* uncomment lines and fix exit

* use bash instead of sh

* Move url checker to the action directory

* Separate spell and url checkers

* Fix bad merge from master

* Fix yml file error

* Add another step to the url checker

Co-authored-by: Carl Lundin <53273776+lundinc2@users.noreply.github.com>
4 years ago
alfred gedeon d428209d01
Fix some broken/redirected URL (#172)
* Style: fix some broken/redirect links

* Fix: atmel url

* Fix microchip typo

* Fix url links

* Fix shortcut link

* Comment: fix line wrapping

* Style: fix line wrapping to 80 chars

* Add now microchip beside Atmel

* Fix link in History

* Add Now Microchip before Atmel link

* Comment: add *
4 years ago
Cobus van Eeden 375b085295
Updated wording of ulTaskNotifyTakeIndexed fix (#178) 4 years ago
Cobus van Eeden 385e700953
Update History.txt and fix versioning in asm files (#177) 4 years ago
David Chalco 3604527e3b
Update version number to 10.4.1 (#173) 4 years ago
Ravishankar Bhagavandas 31dc8f39bd
Fix: Rename parameter uxIndexToNotify to uxIndexToWaitOn (#174) 4 years ago
Carl Lundin acee77be5b
FreeRTOS Kernel Spelling Update (#170)
* FreeRTOS Kernel Spelling Update

* Added spell check to kernel repository.
* Fixed small spelling errors in various kernel source files.
* Added documentation for spellcheck.

Note: Only kernel files are checked for spelling, and portable files are ignored.
4 years ago
NoMaY (a user of Japan.RenesasRulz.com) 242808132c
Fix broken #warning message in ARM_CMx_MPU/portmacro.h between 10.3.1 and 10.4.0 (#171) 4 years ago
RichardBarry 85768bb3e0
Sets the version number to 10.4.0 in assembly files. The (#166)
assembly files were missed when the other source files had
their version numbers updated.
4 years ago
David Chalco 5dfab0306b
Update version number to 10.4.0 (#153) 4 years ago
yngki c1dff8fe95
Update History.txt (#160)
* Update History.txt

* Update History.txt

Co-authored-by: Cobus van Eeden <35851496+cobusve@users.noreply.github.com>
4 years ago
alfred gedeon 16bc35c21c
Fix: Comment - xTaskIncrementTick loop - to adhere to demo requirement (#162)
Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>
4 years ago
Joseph Julicher 2f14899ce8
Revert "RISC-V: Add RV32E / FPU support for GCC (#140)" (#163)
This reverts commit 0037a6c574.
4 years ago
Cobus van Eeden cfb51b3db8
Add url link for Linux Simulator documentation (#161) 4 years ago
Emmanuel Puerto 0037a6c574
RISC-V: Add RV32E / FPU support for GCC (#140)
* Change vPortSetupTimerInterrupt in order to have 64bits access on rv64

* Support RV32E - RISC-V architecture (GCC)

Signed-off-by: Emmanuel Puerto <emmanuel.puerto@sifive.com>

* Support FPU - RISC-V architecture (GCC)

Signed-off-by: Emmanuel Puerto <emmanuel.puerto@sifive.com>

* Fix interrupt managment and FPU initialization
4 years ago
sherryzhang 524e78d58b
Introduce Trusted Firmware M support in Kernel on ARM Cortex M33 (#108)
This port adds the support that FreeRTOS applications can call the secure
    services in Trusted Firmware M(TF-M) via PSA Platform Security
    Architecture(PSA) API based on Arm Cortex-M33 platform with GCC compiler.

    More information:
    PSA - https://www.arm.com/why-arm/architecture/platform-security-architecture
    TF-M - https://git.trustedfirmware.org/trusted-firmware-m.git/

Change-Id: I2e771b66e8d75927abc2505a187a16250d504db2
Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
4 years ago
YuguoWH 651289ef04
Synopsys ARC v1 Port: add support to Synopsys ARC v1 series cores (#110)
* Synopsys Port: Adding support to Synopsys ARC v1 series cores
ARC v1 cores include ARC605, ARC610d, and ARC710d

Signed-off-by: Yuguo Zou <yuguo.zou@synopsys.com>

* Synopsys ARC v1 port: run uncrustify to fix code style

Signed-off-by: Yuguo Zou <yuguo.zou@synopsys.com>

* Synopsys port: modify license headers, change copyright only

Signed-off-by: Yuguo Zou <yuguo.zou@synopsys.com>
4 years ago
alfred gedeon 35f0b2ab84
Change the Linux Port to use condition variables instead of Signals (#156)
* Posix port with pthread cond instead of signals
* Comment: replace signal with pthread_cond
Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>
4 years ago
RichardBarry 700c1cf9c6
Fix compiler warning in config assert() on 64 bit architecture (#158)
* Replace the following code that was used to force an assert:
configASSERT( pxTCB->ulNotifiedValue[ uxIndexToNotify ] == ~0UL );

with:
configASSERT( xTickCount == ( TickType_t ) 0 );

Because the former generates a warning on 64-bit architectures.
4 years ago
Ming Yue 82fdc1c3ee
Change the header file name into lower case so it can work on GNU/Linux for MinGW cross-compiling. (#144) 4 years ago
alfred gedeon 148c81a7bc
Revert "Fix: Add Parenthesis around if-statement in macro (#138)" (#148)
This reverts commit 45e97bd246.
4 years ago
Ming Yue 58ffcb1a6d
Revert "Fix race condition when tracing is enabled (#95)" (#149)
This reverts commit 61635d5b8b.
4 years ago
RichardBarry ce39ebe45b
Update history.txt (#150)
* Update History.txt ready for the 10.4.0 release.
4 years ago
Gary Wicker 5308b1a023
Use unsigned constant in pdMS_TO_TICKS(). (#147) 4 years ago
Cobus van Eeden d7fd5a1195
Revert "Fix inaccurate ticks in windows port (#142)" (#143)
This reverts commit d85fd461d9.
4 years ago
Cobus van Eeden d85fd461d9
Fix inaccurate ticks in windows port (#142) 4 years ago
Cobus van Eeden 805b15a022
Removing general-inquiry.md to divert people to the forums. (#141) 4 years ago
alfred gedeon 45e97bd246
Fix: Add Parenthesis around if-statement in macro (#138)
Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>
4 years ago
Ravishankar Bhagavandas 1d8df4752e
Update Renesas GCC compiler ports (#135)
* Add RX200 GCC compiler

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Update GCC compiler for:
 * RX600v2
 * RX600
 * RX100

Signed-off-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>

* Use configINCLUDE_PLATFORM_H_INSTEAD_OF_IODEFINE_H flag

* Use configINCLUDE_PLATFORM_H_INSTEAD_OF_IODEFINE_H flag RX100, RX200

Co-authored-by: Dinh Van Nam <vannam.dinh.xt@renesas.com>
5 years ago