CanMV-IDE报错

Viewed 451

报错内容:<3>[4] [Func]:vb_do_ioctl [Line]:1777 [Info]:VB not initialized!

2 Answers

你好,这个并不是报错,是固件的正确行为。

不知道啥原因,我的程序貌似只能执行到MediaManager.init()这一句,串行终端打印一句buffer pool : 3然后后面的就不执行了,所有和媒体有关的程序都跑不同

麻烦发一下py脚本,以及ide的日志和串口终端的日志

您好,贴在下面了

串口终端:RX:phy addr is 1012d000
phy addr is 101c3000
phy addr is 10259000
phy addr is 102ef000
yaddr is 1012d000 uvaddr is 10178000
[E/USB] ep:81 clear halt

[E/USB] ep:81 clear halt

[E/USB] ep:81 clear halt

[W/USB] read timeout


IDE:display test
buffer pool : 3

代码:

import time, os, urandom, sys
from media.display import *
from media.media import *
DISPLAY_WIDTH = ALIGN_UP(640, 16)
DISPLAY_HEIGHT = 480
def display_test():
    print("display test")

# create image for drawing
img = image.Image(DISPLAY_WIDTH, DISPLAY_HEIGHT, image.ARGB8888)

# use lcd as display output
Display.init(Display.VIRT, width = DISPLAY_WIDTH, height = DISPLAY_HEIGHT, fps = 60)
# init media manager
MediaManager.init()
print("begin")
try:
    while True:
        img.clear()
        for i in range(10):
            x = (urandom.getrandbits(11) % img.width())
            y = (urandom.getrandbits(11) % img.height())
            r = (urandom.getrandbits(8))
            g = (urandom.getrandbits(8))
            b = (urandom.getrandbits(8))
            size = (urandom.getrandbits(30) % 64) + 32
            # If the first argument is a scaler then this method expects
            # to see x, y, and text. Otherwise, it expects a (x,y,text) tuple.
            # Character and string rotation can be done at 0, 90, 180, 270, and etc. degrees.
            img.draw_string_advanced(x,y,size, "Hello World!,你好世界!!!", color = (r, g, b),)

        # draw result to screen
        Display.show_image(img)

        time.sleep(1)
        os.exitpoint()
except KeyboardInterrupt as e:
    print("user stop: ", e)
except BaseException as e:
    print(f"Exception {e}")

# deinit display
Display.deinit()
os.exitpoint(os.EXITPOINT_ENABLE_SLEEP)
time.sleep_ms(100)
# release media buffer
MediaManager.deinit()
if __name__ == "__main__":
    os.exitpoint(os.EXITPOINT_ENABLE)
    display_test()

你好,换一个usb口或者usb线是否可以正常运行?这个看起来是usb通信失败了,可能是供电不足或者usb线松动导致的。

神医啊,多谢解答,可以运行了