报错内容:<3>[4] [Func]:vb_do_ioctl [Line]:1777 [Info]:VB not initialized!
你好,这个并不是报错,是固件的正确行为。
串口终端:RX:phy addr is 1012d000
phy addr is 101c3000
phy addr is 10259000
phy addr is 102ef000
yaddr is 1012d000 uvaddr is 10178000
[31m[E/USB] ep:81 clear halt
[0m[31m[E/USB] ep:81 clear halt
[0m[31m[E/USB] ep:81 clear halt
[0m[33m[W/USB] read timeout
[0m
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()