Hi there - I'm currently evaluating embOS for use on a custom board. The board's main IC is a Intel MAX10 FPGA with a Nios2 soft core. I can get embOS to run (to an extent....) with certain BSP configurations and not for others. The most noticeable issue is when I deselect 'enable small c library' (in other words, when I'm using the large c library) in the BSP, then OS_Init() never exits. After debugging, I see that OS_Init() calls memset() to initialize the system stack - but a this contains an overflow error: memset() overwrites adjacent memory - the most obvious of which is the 3rd parameter of memset (size) which then causes memset to run indefinitely. Changing the size of the system stack doesn't change this behaviour.
In the attached screenshot, you can see what's going on a bit more clearly: memset is called with a start address of 0x432800 (m) and a size of 4044 bytes (n). However, as you can see from the gdb output, the address of n is 0x4337c8 which means its going to get overwritten as the end of the block that memset is working with is 0x4337cc.
If I enable the small c library, then this does not occur - but I do get other weird issues (some variables on the system stack seem to get overwritten during task switches).
Can someone look into this? I'm happy to provide more information if needed.
My setup:
Nios2/f processor with 79872 bytes on chip RAM using VIC
Nios2 boots/XIP from external flash (QSPI 1Gbit)
Clock: PLL 108Mhz
embOS: 5.8.2. I followed UM01035 guide for setup (hello world)
Dev environment: Nios2 Software Build Tools for Eclipse (Quartus 2 V20.1.0 Standard Edition)
It might be worth noting that this configuration and environment works fine without an OS.
In the attached screenshot, you can see what's going on a bit more clearly: memset is called with a start address of 0x432800 (m) and a size of 4044 bytes (n). However, as you can see from the gdb output, the address of n is 0x4337c8 which means its going to get overwritten as the end of the block that memset is working with is 0x4337cc.
If I enable the small c library, then this does not occur - but I do get other weird issues (some variables on the system stack seem to get overwritten during task switches).
Can someone look into this? I'm happy to provide more information if needed.
My setup:
Nios2/f processor with 79872 bytes on chip RAM using VIC
Nios2 boots/XIP from external flash (QSPI 1Gbit)
Clock: PLL 108Mhz
embOS: 5.8.2. I followed UM01035 guide for setup (hello world)
Dev environment: Nios2 Software Build Tools for Eclipse (Quartus 2 V20.1.0 Standard Edition)
It might be worth noting that this configuration and environment works fine without an OS.