- 最后登录
- 2019-12-6
- 在线时间
- 2438 小时
- 注册时间
- 2011-1-24
- 威望
- 1715分
- 芯币
- 13560枚
- E金币
- 235枚(兑换)
- 学分
- 9分
- 好友
- 22
- 积分
- 5
纯净的硅(高级)

 
|

楼主 |
发表于 2015-4-27 00:05
|
显示全部楼层
freebsder 发表于 2015-4-26 21:52
看了下你之前的代码,不知道有没有改变,
M0侧:
int main(void) {
SystemCoreClockUpdate();
Board_Init();
。。。
Chip_MBOX_Init(LPC_MBOX);
M4侧:
int main(void) {
SystemCoreClockUpdate();
Board_Init();
。。。。
Chip_MBOX_Init(LPC_MBOX);
Board_Init() 和 MBOX 应该在 M4 里初始化一次就好。
M0里面又初始化了一次,主要是得在Board_Init()里面把DEBUGINIT()完成
使用库里面的DEBUGOUT和Board_UARTPutSTR函数
如果不调用的话,是没办法串口打印的
这两个函数比较方便,驱动c文件里面也大量使用了
刚才把所有相关函数的都注释掉了
情况还是一样
![]()
- int main(void) {
- unsigned char value[4];
- // Read clock settings and update SystemCoreClock variable
- SystemCoreClockUpdate();
- // Set up and initialize all required blocks and
- // functions related to the board hardware
- // Board_Init();
- myCoreBox = MAILBOX_CM0PLUS;
- otherCoreBox = MAILBOX_CM4;
- // Chip_MBOX_Init(LPC_MBOX);
- // mutexGive();
- LCD_GPIO_INIT();
- Lcd_Init(); //tft初始化
- LCD_Clear(WHITE); //清屏
- BACK_COLOR=BLACK;
- POINT_COLOR=WHITE;
- showimage();
- SysTick_Config(SystemCoreClock/10);
- // TODO: insert code here
- if (adcrom_init()) {
- return 1;
- }
- /* Configure the ADC */
- if (adcrom_config()) {
- return 1;
- }
- // Board_UARTPutSTR("Core M0+ boot......\r\n");
- NVIC_EnableIRQ(MAILBOX_IRQn);
- // Force the counter to be placed into memory
- volatile static int i = 0 ;
- // Enter an infinite loop, just incrementing a counter
- while(1) {
- i++;
- if(cnt_m0 = 8){
- LCD_ShowNum(35,80,data,4);
- if(led_flag){LCD_ShowString(15,95,"LED ON!");}
- else {LCD_ShowString(15,95,"LED OFF!");}
- cnt_m0 = 0;
- }
- }
- return 0 ;
- }
复制代码
|
|