返回官网官方微博

麦步社区-论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
热搜: MAI 表盘
查看: 10720|回复: 12
打印 上一主题 下一主题

[表盘制作教程] 新人求解,按帮助文档搭建开发环境,模拟表盘报错

[复制链接]

1

主题

15

帖子

78

麦力

精华
0
阅读权限
20
在线时间
4 小时

跳转到指定楼层
楼主
发表于 2017-3-12 14:22:11 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 王克_jRj95 于 2017-3-12 14:23 编辑

系统:win10
表盘模拟器


VisualMWatch_W32

模拟器路径 (结尾大图)


E:\VisualMWatch_W32

arm路径:(结尾大图)

C:\Program Files (x86)\GNU Tools ARM Embedded\4.7 2014q2\bin

系统环境变量path:


(结尾大图)

C:\Program Files (x86)\GNU Tools ARM Embedded\4.7 2014q2\bin;E:\VisualMWatch_W32\mbcc\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%JAVA_HOME%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;E:\AMULU\MYSQL\bin;%CATALINA_HOME%\lib;%CATALINA_HOME%\bin;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\


测试对象


卖萌天气表盘    来源于官方开源代码。


主函数代码:


int main()
{
        simulator_init();

        /*创建消息列表窗口*/
        P_Window p_window = init_window();
        /*放入窗口栈显示*/
        g_window_id = app_window_stack_push(p_window);
        
        //请求GPS数据并注册回调
        request_gps_info();
        
        /*注册接受手机数据回调函数*/
        maibu_comm_register_phone_callback(gps_info_callback);
               
        //test
        //char city_name[20] = "深圳";
        //request_weather_info(city_name);
        //maibu_comm_register_web_callback(weather_info_callback);

        uint32_t request_time = 15 * 60 * 1000;//默认5分钟请求数据
        if(get_date_flag() == false)
        {
                request_time = 15 * 60 * 1000;
        }

        if(strlen(g_city) == 0)
        {//在没有城市数据的情况下进行快速查询
                request_time = 5 * 1000;//在没有获取过数据的情况下5秒获取一次数据

                g_callback_request_flag = 1;//设置快速查询标志
        }
        
        app_service_timer_subscribe(request_time, app_weather_update_timer_callback, NULL);        
        /*注册一个事件通知回调,当有时间改变时,立即更新时间*/
        maibu_service_sys_event_subscribe(time_change);

        /*注册通讯结果回调*/
        maibu_comm_register_result_callback(weather_comm_result_callback);

        simulator_wait();
        return 0;

}


测试日志:   主要报错+详情

主要报错信息:(忽略warning)
生成资源文件...
not found file:.\build\maibu_code
create pack failed
正在编译...
readelf: Error: '.\build\maibu_code': No such file
正在打包...
not found file:.\build\maibu_code
create pack failed
正在编译...
E:\VisualMWatch_W32\new_weather_watchface.c: In function 'request_gps_info':
E:\VisualMWatch_W32\new_weather_watchface.c:594:2: error: too few arguments to function 'maibu_comm_request_phone'
mbcc\bin\mw.exe' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

详情

生成资源文件...
-------------read appinfo.json-------------
uuid:39fe260221d9717da155d14404ca4054
app_id:33280
name:��������
icon:5001
version:127
watchface:0
sysapp:1
res_num:10
res:0, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_BG, file:watchface-bg.bmp
res:1, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_UPDATING, file:updating.bmp
res:2, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_CLOUDY_DAY, file:cloudy_day.bmp
res:3, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_CLOUDY_NIGHT, file:cloudy_night.bmp
res:4, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_FOG, file:fog.bmp
res:5, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_OVERCAST, file:overcast.bmp
res:6, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_RAIN, file:rain.bmp
res:7, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_SNOW, file:snow.bmp
res:8, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_SUNNY_DAY, file:sunny_day.bmp
res:9, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_SUNNY_NIGHT, file:sunny_night.bmp

-----------------begin create res.h-------------
-----------------create res.h ok-------------
-----------------begin create res_file-------------
type:0, res_key:5001, offset:171, res_size:2048, width:128, height:128
type:0, res_key:5002, offset:2219, res_size:1600, width:128, height:100
type:0, res_key:5003, offset:3819, res_size:600, width:80, height:60
type:0, res_key:5004, offset:4419, res_size:600, width:80, height:60
type:0, res_key:5005, offset:5019, res_size:600, width:80, height:60
type:0, res_key:5006, offset:5619, res_size:600, width:80, height:60
type:0, res_key:5007, offset:6219, res_size:600, width:80, height:60
type:0, res_key:5008, offset:6819, res_size:600, width:80, height:60
type:0, res_key:5009, offset:7419, res_size:600, width:80, height:60
type:0, res_key:5010, offset:8019, res_size:600, width:80, height:60
-------------create res_file ok---------------
---------------prepare pack head----------
---------------read res_file----------
---------------read code----------
not found file:.\build\maibu_code
create pack failed
正在编译...
arm-none-eabi-gcc -c -mthumb -mcpu=cortex-m0 new_weather_watchface.c -I .\SDK\
In file included from new_weather_watchface.c:7:0:
maibu_res.h:3:0: warning: "RES_BITMAP_WATCHFACE_WEATHER_BG" redefined [enabled by default]
In file included from .\SDK/maibu_sdk.h:120:0,
                 from new_weather_watchface.c:6:
.\SDK/maibu_res_bitmap_base_sdk.h:76:0: note: this is the location of the previous definition
new_weather_watchface.c: In function 'set_waiting_info_str':
new_weather_watchface.c:272:22: warning: initialization makes pointer from integer without a cast [enabled by default]
new_weather_watchface.c: In function 'weather_info_callback':
new_weather_watchface.c:390:22: warning: initialization makes pointer from integer without a cast [enabled by default]
new_weather_watchface.c: In function 'city_info_callback':
new_weather_watchface.c:505:22: warning: initialization makes pointer from integer without a cast [enabled by default]
new_weather_watchface.c: In function 'request_gps_info':
new_weather_watchface.c:594:2: error: too few arguments to function 'maibu_comm_request_phone'
In file included from .\SDK/maibu_sdk.h:126:0,
                 from new_weather_watchface.c:6:
.\SDK/maibu_ble.h:135:17: note: declared here
new_weather_watchface.c: In function 'time_change':
new_weather_watchface.c:611:23: warning: initialization makes pointer from integer without a cast [enabled by default]
new_weather_watchface.c: In function 'app_weather_update_timer_callback':
new_weather_watchface.c:831:23: warning: initialization makes pointer from integer without a cast [enabled by default]
new_weather_watchface.c: In function 'weather_comm_result_callback':
new_weather_watchface.c:873:4: error: too few arguments to function 'maibu_comm_request_phone'
In file included from .\SDK/maibu_sdk.h:126:0,
                 from new_weather_watchface.c:6:
.\SDK/maibu_ble.h:135:17: note: declared here
new_weather_watchface.c: In function 'main':
new_weather_watchface.c:903:2: warning: passing argument 1 of 'maibu_comm_register_phone_callback' from incompatible pointer type [enabled by default]
In file included from .\SDK/maibu_sdk.h:126:0,
                 from new_weather_watchface.c:6:
.\SDK/maibu_ble.h:121:13: note: expected 'CBCommPhone' but argument is of type 'void (*)(enum ERequestPhone,  void *)'
arm-none-eabi-ld: cannot find .\*.o: Invalid argument
readelf: Error: '.\build\maibu_code': No such file
正在打包...
-------------read appinfo.json-------------
uuid:39fe260221d9717da155d14404ca4054
app_id:33280
name:��������
icon:5001
version:127
watchface:0
sysapp:1
res_num:10
res:0, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_BG, file:watchface-bg.bmp
res:1, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_UPDATING, file:updating.bmp
res:2, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_CLOUDY_DAY, file:cloudy_day.bmp
res:3, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_CLOUDY_NIGHT, file:cloudy_night.bmp
res:4, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_FOG, file:fog.bmp
res:5, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_OVERCAST, file:overcast.bmp
res:6, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_RAIN, file:rain.bmp
res:7, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_SNOW, file:snow.bmp
res:8, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_SUNNY_DAY, file:sunny_day.bmp
res:9, type:0, name:RES_BITMAP_WATCHFACE_WEATHER_SUNNY_NIGHT, file:sunny_night.bmp

-----------------begin create res.h-------------
-----------------create res.h ok-------------
-----------------begin create res_file-------------
type:0, res_key:5001, offset:171, res_size:2048, width:128, height:128
type:0, res_key:5002, offset:2219, res_size:1600, width:128, height:100
type:0, res_key:5003, offset:3819, res_size:600, width:80, height:60
type:0, res_key:5004, offset:4419, res_size:600, width:80, height:60
type:0, res_key:5005, offset:5019, res_size:600, width:80, height:60
type:0, res_key:5006, offset:5619, res_size:600, width:80, height:60
type:0, res_key:5007, offset:6219, res_size:600, width:80, height:60
type:0, res_key:5008, offset:6819, res_size:600, width:80, height:60
type:0, res_key:5009, offset:7419, res_size:600, width:80, height:60
type:0, res_key:5010, offset:8019, res_size:600, width:80, height:60
-------------create res_file ok---------------
---------------prepare pack head----------
---------------read res_file----------
---------------read code----------
not found file:.\build\maibu_code
create pack failed


正在编译...

E:\VisualMWatch_W32\new_weather_watchface.c: In function 'request_gps_info':
E:\VisualMWatch_W32\new_weather_watchface.c:594:2: error: too few arguments to function 'maibu_comm_request_phone'
  g_comm_id_gps = maibu_comm_request_phone(ERequestPhoneGPSAltitude, NULL);
  ^
In file included from e:\visualmwatch_w32\mbcc\include\maibu_sdk.h:23:0,
                 from E:\VisualMWatch_W32\new_weather_watchface.c:6:
e:\visualmwatch_w32\mbcc\include\os_comm.h:305:10: note: declared here
uint32_t maibu_comm_request_phone(enum ERequestPhone type,  uint8_t  *context, uint16_t context_size);
          ^
E:\VisualMWatch_W32\new_weather_watchface.c: In function 'weather_comm_result_callback':
E:\VisualMWatch_W32\new_weather_watchface.c:873:4: error: too few arguments to function 'maibu_comm_request_phone'
    g_comm_id_gps = maibu_comm_request_phone(ERequestPhoneGPSAltitude,  NULL);
    ^
In file included from e:\visualmwatch_w32\mbcc\include\maibu_sdk.h:23:0,
                 from E:\VisualMWatch_W32\new_weather_watchface.c:6:
e:\visualmwatch_w32\mbcc\include\os_comm.h:305:10: note: declared here
uint32_t maibu_comm_request_phone(enum ERequestPhone type,  uint8_t  *context, uint16_t context_size);
          ^
E:\VisualMWatch_W32\new_weather_watchface.c: In function 'main':
E:\VisualMWatch_W32\new_weather_watchface.c:903:2: warning: passing argument 1 of 'maibu_comm_register_phone_callback' from incompatible pointer type [enabled by default]
  maibu_comm_register_phone_callback(gps_info_callback);
  ^
In file included from e:\visualmwatch_w32\mbcc\include\maibu_sdk.h:23:0,
                 from E:\VisualMWatch_W32\new_weather_watchface.c:6:
e:\visualmwatch_w32\mbcc\include\os_comm.h:306:6: note: expected 'CBCommPhone' but argument is of type 'void (*)(enum ERequestPhone,  void *)'
void maibu_comm_register_phone_callback(CBCommPhone phone_callback);
      ^
'mbcc\bin\mw.exe' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信 WeiboWeibo
收藏收藏1 分享分享 顶 踩

1

主题

15

帖子

78

麦力

精华
0
阅读权限
20
在线时间
4 小时

沙发
 楼主| 发表于 2017-3-12 21:07:25 | 只看该作者
经过一番研究,发现不是环境配置的问题,是开源代码的问题,目前还没确定问题的具体位置,希望给为看到帖子的吧友相互交流,交流

66

主题

915

帖子

1万

麦力

精华
8
阅读权限
80
在线时间
1040 小时

麦步极客实验室麦步增强版用户

板凳
发表于 2017-3-12 21:13:51 来自手机 | 只看该作者
试试demo里的简单例子

1

主题

15

帖子

78

麦力

精华
0
阅读权限
20
在线时间
4 小时

地板
 楼主| 发表于 2017-3-12 23:33:21 | 只看该作者
qs100371 发表于 2017-3-12 21:13
试试demo里的简单例子

demo的例子实验都是成功的

1

主题

15

帖子

78

麦力

精华
0
阅读权限
20
在线时间
4 小时

5#
 楼主| 发表于 2017-3-12 23:34:32 | 只看该作者
错误研究进展:
与gps有关的错误,gps参数不足
new_weather_watchface.c:594:2: error: too few arguments to function 'maibu_comm_request_phone'
In file included from .\SDK/maibu_sdk.h:126:0,
                 from new_weather_watchface.c:6:
.\SDK/maibu_ble.h:135:17: note: declared here
new_weather_watchface.c: In function 'time_change':

于gps有关的错误,gps参数不足

E:\VisualMWatch_W64\new_weather_watchface.c:594:18: error: too few arguments to function 'maibu_comm_request_phone'
  g_comm_id_gps = maibu_comm_request_phone(ERequestPhoneGPSAltitude, NULL);
                  ^
In file included from .\mbcc\include/maibu_sdk.h:23:0,
                 from E:\VisualMWatch_W64\new_weather_watchface.c:6:
.\mbcc\include/os_comm.h:305:10: note: declared here
uint32_t maibu_comm_request_phone(enum ERequestPhone type,  uint8_t  *context, uint16_t context_size);
          ^
分析结果:
1.缺少gps参数
        readelf: Error: '.\build\maibu_code': No such file
2.找不到maibu_code 文件



实时天气:
Gps参数缺少:
watchface_weather.c:682:3: error: too few arguments to function 'maibu_comm_request_phone'
In file included from .\SDK/maibu_sdk.h:126:0,
                 from watchface_weather.c:50:
.\SDK/maibu_ble.h:135:17: note: declared here
watchface_weather.c: In function 'main':


watchface_weather.c:721:2: error: too few arguments to function 'maibu_comm_request_phone'
In file included from .\SDK/maibu_sdk.h:126:0,
                 from watchface_weather.c:50:
.\SDK/maibu_ble.h:135:17: note: declared here
arm-none-eabi-ld: cannot find .\*.o: Invalid argument



计数器:

找不到头文件os_res_bitmap.h
E:\VisualMWatch_W64\watchface_weather.c:36:27: fatal error: os_res_bitmap.h: No such file or directory
#include "os_res_bitmap.h"
                           ^
compilation terminated.


readelf: Error: '.\build\maibu_code': No such file



总结:
天气类软件
1.        获取gps的函数参数不足:估计是没有连接手机的原因,无法获取gps数据,需要自己给定。
2.        找不到maibu_code.  :目前不清楚原因
非天气类软件
1.找不到头文件:os_res_bitmap  :目前不清楚原因

26

主题

792

帖子

1万

麦力

精华
1
阅读权限
100
在线时间
691 小时

麦步手表用户麦步工业测评协会

6#
发表于 2017-3-12 23:46:28 | 只看该作者
你这些都是自己写的吗

1

主题

15

帖子

78

麦力

精华
0
阅读权限
20
在线时间
4 小时

7#
 楼主| 发表于 2017-3-13 00:04:24 | 只看该作者
tda8361 发表于 2017-3-12 23:46
你这些都是自己写的吗

代码是官网下载的,问题总结自己写的

23

主题

1532

帖子

9071

麦力

精华
0
阅读权限
80
在线时间
103 小时

8#
发表于 2017-3-13 00:35:31 | 只看该作者
顶你
回复

使用道具 举报

66

主题

915

帖子

1万

麦力

精华
8
阅读权限
80
在线时间
1040 小时

麦步极客实验室麦步增强版用户

9#
发表于 2017-3-13 05:47:58 来自手机 | 只看该作者
上github下源码,不要用论坛上下的。地址在开发者板块。

1

主题

15

帖子

78

麦力

精华
0
阅读权限
20
在线时间
4 小时

10#
 楼主| 发表于 2017-3-13 10:08:17 | 只看该作者

谢谢吧友捧场
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|麦步官方论坛 ( 粤ICP备12052190号  

GMT+8, 2024-4-30 18:27 , Processed in 0.082975 second(s), 25 queries .

Powered by Discuz! X3.2

© 2012-2021 Comsenz Inc.

快速回复 返回顶部 返回列表