0
我對mbed和uvisor來說很新,所以也許我的問題是要了解事情的工作原理。我有一個恩智浦FRDM-K64F板,我正在嘗試瞭解mbed和uvisor。我已經成功編譯了一些運行在不同盒子上的任務的基本示例。我試圖連接到uvisor中的網絡盒子,但有些東西無法正常工作。mbed uvisor和EthernetInterface溢出
這是主要文件代碼:
#include "uvisor-lib/uvisor-lib.h"
#include "mbed.h"
#include "main-hw.h"
/* Create ACLs for main box. */
MAIN_ACL(g_main_acl);
/* Enable uVisor. */
UVISOR_SET_MODE_ACL(UVISOR_ENABLED, g_main_acl);
UVISOR_SET_PAGE_HEAP(8 * 1024, 5);
int main(void)
{
printf("----Eup---------\r\n");
DigitalOut led(MAIN_LED);
while (1) {
printf("taka\r\n");
led = !led;
/* Blink once per second. */
Thread::wait(1000);
}
return 0;
}
這是箱文件中的代碼:
#include "uvisor-lib/uvisor-lib.h"
#include "mbed.h"
#include "main-hw.h"
#include "EthernetInterface.h"
// Network interface
EthernetInterface net;
struct box_context {
Thread * thread;
uint32_t heartbeat;
};
static const UvisorBoxAclItem acl[] = {
};
static void my_box_main(const void *);
/* Box configuration
* We need 1kB of stack both in the main and interrupt threads as both of them
* use printf. */
UVISOR_BOX_NAMESPACE(NULL);
UVISOR_BOX_HEAPSIZE(3072);
UVISOR_BOX_MAIN(my_box_main, osPriorityNormal, 1024);
UVISOR_BOX_CONFIG(my_box, acl, 1024, box_context);
static void my_box_main(const void *)
{
while (1) {
printf("tan tan\r\n");
Thread::wait(2000);
}
}
我還沒有被添加到特定的連接代碼,該EthernetInterface對象只是定義並且編譯時出現以下錯誤:
../../../../arm-none-eabi/bin/ld.exe: Region m_data_2 overflowed with stack and heap
collect2.exe: error: ld returned 1 exit status
我試過changi ng堆大小的值,但我還沒有找到一種方法使其工作。我錯過了什麼?