Recently,I ''m under a project with C8051F350.This MCU have 24bit ADC ,8K flash ,256+512Bytes RAM,and one of the most improtant is that ,the flash can be usedlike eeprom with 512bytes per sector earse,althoughit''scapability upto 8k ,the last sector is reserve.The module in my project ,Exucted code comes to 6672 bytes,that seen enought.Anohter problem came up when i use the sector start at 0x1c00,no respone ,and the data can''t write into sector 0x1c00.I get the datasheet and read againt.And i found some notes:
When one of the flash page/sector is locked ,the page/sector located at 0x1c00 is locked.That means can''t eigther earsenor write.Excute code can''t optimize anymore .Must be another way!
I met this before.I solved that by using scatter relocated the obj to non-sequence address.Under the same way,i google the relocated in Keilc .
Finally ,Idone!
Here is a example for Relocate functions.
For more detail ,RE me.

>> 阅读全文

Here is uCOS about Mailbox postcode:
OS_ENTER_CRITICAL(); if (pevent->OSEventGrp != 0x00) { /* See if any task pending on mailbox */ OS_EventTaskRdy(pevent, msg, OS_STAT_MBOX); /* Ready highest priority task waiting on event */ OS_EXIT_CRITICAL(); OS_Sched(); /* Find highest priority task ready to run */ return (OS_NO_ERR); } if (pevent->OSEventPtr != (void *)0) { /* Make sure mailbox doesn''''t already have a msg */ OS_EXIT_CRITICAL(); return (OS_MBOX_FULL); } pevent->OSEventPtr = msg; /* Place message in mailbox */ OS_EXIT_CRITICAL(); return (OS_NO_ERR);
I want to say, what Mailbox post isan pointor .
Internal a function ,private variables will be free at the end of the function.If we send a private variables by OSMBoxPost,the target may get a wrong data.
Here is a test code:
///Test1.cvoid task1(void *pd)
{
char buf[16];char cnt;pd=pd;
OSMboxCreate();while(1)
{
s...

>> 阅读全文

我已经在嵌入式在线BLOG安家了.
我的BLOG地址: http://blog.mcuol.com/gdpiao
http://gdpiao.21ic.org

>> 阅读全文