Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

EPCS under uCOS/II

Altera_Forum
Honored Contributor II
1,067 Views

I'm trying to programme an EPCS over TCP/IP and NIOS running uCOS/II. Problem is, the only way to access the EPCS is via HAL API, which says "single threaded only". Small operations, like a single erase or reading a few hundred bytes are OK, but if I try to read a few KB via a single call, the OS crashes with semaphore failures etc. So my question is " can you use the HAL EPCS functions under uCOS/II ?"

0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
339 Views

Hi, 

I had the same problem programming CIF flash over TCP/IP. My solution was to suspend the higher priority tasks before i begin writing flash, and then resume them. It works. 

bye
0 Kudos
Altera_Forum
Honored Contributor II
339 Views

Soin 

 

I've tried OSSchedLock/OSSchedUnlock bracketing the EPCS access function - still get the same problem - is this what you meant, or am I missing something ? 

 

Alan
0 Kudos
Altera_Forum
Honored Contributor II
339 Views

Hi AlanBall, 

I simply used the functions OSTaskSuspend(),OSTaskResume().I think the functions you are using, have the same effect.So have you check your task stack size?Only an idea... 

bye
0 Kudos
Altera_Forum
Honored Contributor II
339 Views

Yep, thought of stack size - no effect 

I have however now got this to work by opening the EPCS device before each individual API call (which might read or write an entire block) and closing it afterwards, rather than leaving the device open throughout several API calls. I have NO idea why this makes a difference, but it does. I've also left the OSSchedlock/unlock bracketing the entire function for good measure  

 

Any insights would be welcome ! 

 

Alan
0 Kudos
Reply