tag 标签: rtos

相关帖子
相关博文
  • 热度 18
    2023-4-18 14:14
    6816 次阅读|
    0 个评论
    《RT-Thread设备驱动开发指南》--一本适合RT-Thread初学者的好书
    前段时间开始自学rt-thread,刚开始的时候我参考的教程是《 RT-Thread 内核实现与应用开发实战》,这是一份非常好的资料,围绕代码和试验现象详细讲解了每一个函数的作用,但,正是因为它太过事无巨细的讲解,导致我对整个rtt没有一个成体系的概念印象,也可能是因为它比较生涩,初学者看起来有点费劲。所以后来学习进程暂时搁置了。 直到这次有幸获得了《RT-Thread 设备驱动开发指南》的评测机会,只翻看了第一章我就认为《RT-Thread 设备驱动开发指南》是一本非常适合初学者的技术指南,该指南清晰地讲述了 RT-Thread 设备框架结构的概念,从而可以让人更好地理解 RT-Thread 的结构。在这个框架概念的基础上,该指南由浅入深地讲解了从常见的 pin、I2C、SPI 到复杂一些的 SDIO、触摸屏等设备驱动的开发。 首先,该指南的一个主要优点是它清晰地讲解了 RT-Thread 设备框架结构的概念。这个概念对于初学者来说非常重要,因为它可以帮助他们更好地理解 RT-Thread 操作系统的结构和工作原理。通过深入了解 RT-Thread 设备框架结构,开发人员可以更加清晰地了解设备驱动程序在 RT-Thread 中的角色和作用,从而更好地开发他们的应用程序。 其次,该指南围绕 RT-Thread 设备框架结构,由浅入深地讲解了从常见的 pin、I2C、SPI 到复杂一些的 SDIO、触摸屏等设备驱动的开发。这种基于实例的学习方式非常适合初学者,因为它可以帮助他们从实际问题中学习,提高他们的学习效率。通过在实际项目中演示如何开发各种类型的设备驱动,该指南可以让初学者更好地理解每个设备的特点和要求,并帮助他们开发高质量的设备驱动程序。 由于该指南以简单易懂的语言和实际项目为例进行讲解,结合详细的注释和解释,因此可以让初学者轻松理解和掌握书中的内容。此外,该指南在讲解设备驱动开发的过程中,也给出了很多实用的建议和技巧,可以让初学者更加高效地进行设备驱动开发。 总之,《RT-Thread 设备驱动开发指南》是一本非常优秀的技术指南,它清晰地讲解了 RT-Thread 设备框架结构的概念,并且围绕这个概念由浅入深地讲解了从常见的 pin、I2C、SPI 到复杂一些的 SDIO、触摸屏等设备驱动的开发。对于初学者来说,该指南是一本非常适合他们的案头书,常读常新。
  • 热度 3
    2019-11-30 17:54
    15263 次阅读|
    1 个评论
    【RT-Thread软件包+w601评测】开发板上手点灯
    正点原子W601 WIFI 物联网开发板 是原子科技基于国产 物联网无线通信芯片供应商北京联盛德微电子有限责任公司 开发的 WIFI MCU 芯片W 601, 主打家电市场。 联盛德官网 http://www.winnermicro.com/ 这款开发板原子科技官方淘宝店只卖98元,读者可以自行搜索购买 原子科技联合 RT -thread为这款开发板提供了软件开发套件支持 资料下载链接:https://pan.baidu.com/s/1UwbrQBbNt3Vnf9DGoETymg 提取码:q6dc 芯片资源: 该 SoC 芯片集成 Cortex-M3 内核,内置 Flash,支持 SDIO、SPI、UART、GPIO、I²C、PWM、I²S、7816、LCD、 ADC 等接口, 支持多种硬件加解密协议,如 PRNG/SHA1/MD5/RC4/DES/3DES/AES/CRC/RSA 等;集成射频 收发前端 RF Transceiver,PA 功率放大器,基带处理器/媒体访问控制。 开发板硬件资源: 软件开发包: 从原子论坛下载的开发板资料,包含各种文档和代码和部分视频 源码部分分两部分,一部分是原子开发的裸机例程,demo了各种外设的使用,提供Keil工程文件。 第二部分是基于RT -Thread RTOS开发的 SDK ,同样提供大量外设和物联网demo , 包含KEIL和 IAR 工程文件。 裸机工程: 打开并编译工程 "E:\boards\ 【正点原子】 W601 开发板光盘资料 \4 ,程序源码 \1 ,裸机例程 \ 实验 1 跑马灯 (RGB) 实验 \USER\ATK_RGB.uvprojx" binary 生成在目录 E:\boards\ 【正点原子】 W601 开发板光盘资料 \4 ,程序源码 \1 ,裸机例程 \ 实验 1 跑马灯 (RGB) 实验 \BIN RT -Thead 工程: 打开i并编译工程 "E:\boards\ 【正点原子】 W601 开发板光盘资料 \4 ,程序源码 \RT-Thread_W60X_SDK\examples\01_basic_led_blink\project.uvprojx" binary 生成在目录 E:\boards\ 【正点原子】 W601 开发板光盘资料 \4 ,程序源码 \RT-Thread_W60X_SDK\examples\01_basic_led_blink\Bin 程序下载: 开发板支持SWD下载,可以用JLINK或者原子商城提供的LINK下载 也可以用串口工具下载: 打开 "E:\boards\ 【正点原子】 W601 开发板光盘资料 \6 ,软件资料 \1 ,软件 \ 星通智联串口调试下载助手 \ThingsTurn_Serial_Tool.exe" 选择串口,选择固件文件,点击下载
  • 热度 29
    2016-6-3 11:52
    1734 次阅读|
    0 个评论
    1). 简介 MQX是由NXP提供的实时操作系统,结构框图如下图所示, 包含内核,文件系统以及协议栈, 同时对于NXP的ARM处理器也可以很好的支持,可以很方便的开发和部署. 本文就基于Toradex Colibri VF61 (基于NXP VF61 SoC) ARM计算机模块搭配Colibri Eva Board开发板来演示编译和部署MQX应用. VF61为异构双核架构ARM处理器,包含一个Cortex-A5和一个Cortex-M4,通常应用场景为A5核心运行Linux或者WinCE系统作为控制和界面显示,M4核心运行一个实时操作系统来处理实时任务. 本文所演示的即是在M4核心上面部署运行MQX应用. 2). 准备 a). 硬件准备 ./ Colibri VF61计算机模块和Colibri Eva Board开发板 ./ Ubuntu Linux开发主机 b). 软件准备 ./ VF61模块A5核心运行Toradex Embedded Linux release V2.5 Beta3 ./ Ubuntu Linux开发主机 ./ MQX RTOS 4.1.2 Vybrid - 从这里下载 ./ Linaro bare-metal toolchain for Cortex-R/M, 4.8 2014-Q1 update - 从这里下载 3). 配置 a). 解压缩到”/home/username”目录下 ------------------------ $ tar xzf “~/MQX RTOS 4.1.2 for Vybrid Linux Base.gz.gz” $ tar xjf ~/gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2 ------------------------ b). 配置MQX ./ 文件 ”FSLMQXOS_4_1_2_Vybrid/build/common/make/global.mak” 设置交叉编译toolchain ------------------------ + TOOLCHAIN_ROOTDIR = /home/yourname/gcc-arm-none-eabi-4_8-2014q3/ ------------------------   ./ 文件  “FSLMQXOS_4_1_2_Vybrid/config/twrvf65gs10_m4/user_config.h” 由于VF61 A5和M4共享外设资源,因此在使用M4外设时候要通过修改A5 Device Tree来确保此外设没有被A5已经占用.本文后续只测试M4调用GPIO,因此将其他和A5冲突的外设资源都去掉,实际应用中可以根据具体情况做配置. ------------------------ ... #define BSPCFG_ENABLE_I2C0                  0 #define BSPCFG_ENABLE_II2C0                  0 ... #define BSPCFG_ENABLE_SPI0                   0 ... #define BSPCFG_ENABLE_RTCDEV               0 ... #define BSPCFG_ENABLE_ESDHC                0 #define BSPCFG_ENABLE_SAI                    0 ... #define BSPCFG_ENABLE_TTYB                   0 #define BSPCFG_ENABLE_ITTYB                  0   #define BSPCFG_ENABLE_TTYC                   1 #define BSPCFG_ENABLE_ITTYC                   0 ... ------------------------   ./ 文件 ”FSLMQXOS_4_1_2_Vybrid/mqx/source/bsp/twrvf65gs10_m4/twrvf65gs10_m4.h” 修改时钟 ------------------------ ... #define BSP_CORE_CLOCK                  (166700000) #define BSP_BUS_CLOCK                   (166700000) #define BSP_SYSTEM_CLOCK                (83300000) #define BSP_IPG_CLOCK                   (83300000) ... ------------------------ 4). 编译MQX a). 替换  “mqx/examples/hello/build/make/hello_twrvf65gs10_m4/build_gcc_arm.sh” 文件 从这里下载文件 b). 编译Helloworld Firmware ------------------------ $ cd mqx/examples/hello/build/make/hello_twrvf65gs10_m4/ $ ./build_gcc_arm.sh ... Build done Press any key to continue... ------------------------ c). 创建binary Firmware文件 ------------------------ $ cd ~/FSLMQXOS_4_1_2_Vybrid/mqx/examples/hello/build/make/hello_twrvf65gs10_m4/gcc_arm/ram_release $ export PATH=~/gcc-arm-none-eabi-4_9-2014q1/bin/:$PATH $ arm-none-eabi-objcopy -O binary hello_twrvf65gs10_m4.elf hello_twrvf65gs10_m4.bin ------------------------ d). 查看应用入口地址 由于二进制程序没有可以指明加载地址或入口地址的头部信息,因此需要在加载的时候手动添加 ------------------------ $ arm-none-eabi-objdump -f hello_twrvf65gs10_m4.elf   hello_twrvf65gs10_m4.elf:     file format elf32-littlearm architecture: arm, flags 0x00000112: EXEC_P, HAS_SYMS, D_PAGED start address 0x3f0007b1 ------------------------ e). 运行MQX 将bin文件复制到Colibri VF61 A5核心的Linux系统上面,运行下面命令启动mcc然后下载并运行MQX在M4核心 ------------------------ # modprobe mcc # mqxboot hello_twrvf65gs10_m4.bin 0x3f000000 0x3f0007b1 ------------------------ f). 查看M4串口输出 将Colibri开发板UARTB接口连接到开发主机 ------------------------ $ sudo minicom -D /dev/ttyUSB1 -d 115200 Welcome to minicom 2.7   OPTIONS: I18n Compiled on Jan  1 2014, 17:13:19. Port /dev/ttyUSB1, 14:58:22 Press CTRL-A Z for help on special keys   Hello World ------------------------ 5). GPIO demo 在M4运行MQX GPIO demo, 通过BSP_BUTTON1来控制打开和关闭BSP_LED1 a). 查看M4对应管脚定义 确定BSP_BUTTON1对应GPIO管脚为PTB16,BSP_LED1对应GPIO管脚为PTB0 ------------------------ $ vi FSLMQXOS_4_1_2_Vybrid/mqx/source/bsp/twrvf65gs10_m4/twrvf65gs10_m4.h   ... #define BSP_LED1                            (LWGPIO_PIN_PTB0) ... #define BSP_SW1                             (LWGPIO_PIN_PTB16) ... #define BSP_BUTTON1                         BSP_SW1 ... ------------------------ b). 确认M4 GPIO管脚资源 通过查询Colibri VF61手册和A5 Linux Device Tree文件, 发现PTB0被A5 Linux pwm0占用,而PTB16虽然被flexcan1占用但默认并为启用,因此首先需要根据这里的说明先重新编译A5 Linux Device Tree文件将pwm0 disable以免管脚资源冲突;然后在Colibri载板上面将PTB0 (SODIMM 59)连接到X21 LED1 (Pin 2), PTB16 (SODIMM 63)连接到X21 SW6 (Pin 11) c). 同样方法编译MQX GPIO Firmware ------------------------ $ cd ~/FSLMQXOS_4_1_2_Vybrid/mqx/examples/gpio/build/make/gpio_twrvf65gs10_m4 $ ./build_gcc_arm.sh $ cd gcc_arm/ram_release/ $ export PATH=~/gcc-arm-none-eabi-4_9-2014q1/bin/:$PATH $ arm-none-eabi-objcopy -O binary gpio_twrvf65gs10_m4.elf gpio_twrvf65gs10_m4.bin $ arm-none-eabi-objdump -f gpio_twrvf65gs10_m4.elf   gpio_twrvf65gs10_m4.elf:     file format elf32-littlearm architecture: arm, flags 0x00000112: EXEC_P, HAS_SYMS, D_PAGED start address 0x3f000e51 ------------------------ d). 部署并测试demo ./ 在VF61 A5 Linux上面部署并运行MQX GPIO到M4 ------------------------ # mqxboot gpio_twrvf65gs10_m4.bin 0x3f000000 0x3f000e51 ------------------------ ./ 在M4 串口输出打印按键3次 ------------------------ ====================== GPIO Example ====================== The (SW1) button is configured to trigger GPIO interrupt. Press the (SW1) button 3x to continue. ------------------------ ./ 按Colibri 开发板SW6 3次后,即可通过SW6控制LED1 ------------------------ Button pressed 3x   The (SW1) button state is now polled. Press the (SW1) button to switch LED on or off   Button pressed ------------------------ 6). MCC Pingpong demo 下面通过MCC Pinpong demo来测试A5和M4之间的信息传递 a). 配置MCC版本 MQX 4.1.2版本默认采用MCC V2版本,但也同时提供了V1版本源代码;由于目前VF61 Linux只支持MCC V1版本,因此首先要用V1版本源代码替换V2版本 ------------------------ $ cd ~/FSLMQXOS_4_1_2_Vybrid/mcc/source $ unzip mcc_version_1_2.zip -d ../.  //按提示选择全部替换 $ vi mcc_vf600.c //如下面红色部分修改 static const unsigned int mcc_cpu_to_cpu_vectors[] = { GIC_CPU_to_CPU_int0, NVIC_CPU_to_CPU_int0 }; ------------------------ b). 编译MCC ------------------------ $ cd ~/FSLMQXOS_4_1_2_Vybrid/mcc//build/make/mcc_twrvf65gs10_m4 $ ./build_gcc_arm.sh ------------------------ c). 编译Pingpong demo ------------------------ $ cd ~/FSLMQXOS_4_1_2_Vybrid/mcc/examples/pingpong/build/make/pingpong_example_twrvf65gs10_m4 $ ./build_gcc_arm.sh ------------------------ d). 部署运行测试Pingpong demo 和之前同样方法获得bin和入口地址,并通过A5 Linux运行到M4上面 ./ A5 Linux部署执行Pingpong demo ------------------------ $ mqxboot pingpong_example_twrvf65gs10_m4.bin 0x3f000000 0x3f001095 ------------------------ ./ 运行后, M4串口输出 ------------------------ Responder task started, MCC version is 001.002   ------------------------ ./ 然后在A5 Linux运行自带的Pingpong应用 ------------------------ mcc-pingpong ------------------------ ./ 然后M4串口输出 ------------------------ Responder task received a msg                                                   Message: Size=4, DATA = 1                                                       Responder task received a msg                                                    Message: Size=4, DATA = 3 ... ------------------------ ./ 同样A5串口输出 ------------------------ version: 001.002                                                                Message: Size=4, DATA = 2 after 0.004325 seconds.                                Message: Size=4, DATA = 4 after 0.004340 seconds.                               Message: Size=4, DATA = 6 after 0.004669 seconds. ... ------------------------ 7). 总结 本文简单展示了在VF61 M4核心上面运行MQX以及A5和M4核心通信例程,可见MQX可以非常方便的部署在NXP处理器上面,详细的MQX应用开发可以参考下面文档. FSLMQXOS_4_1_2_Vybrid/doc http://developer.toradex.com/knowledge-base/mqx-on-the-cortex-m4-of-a-colibri-vf61
  • 热度 19
    2013-8-29 17:53
    1669 次阅读|
    0 个评论
    In this second instalment , we have another expert panel talking about the intellectual property (IP) industry. In part 1 , we tackled the concept of IP as a partnership between the supplier and the user. Taking part in this discussion are Warren Savage, president and CEO of IPextreme; John Koeter, vice president of marketing for the solutions group at Synopsys; and Chris Rowen, Cadence Fellow and CTO of Tensilica. EE Times : When the IP industry was first being formed, a lot of people would create a piece of RTL IP, hang out a shingle, and attempt to start selling it. They quickly realised that there was more to it than this. Have we moved beyond the point where this is within the realm of a start-up? Warren Savage : I don't think so. For example, we have our constellations program. It is a lot of smaller companies, very smart people with innovative ideas. There has been enough written about IP in the last 15 years, and the industry itself has matured enough such that there's been success stories written. People know how to put IP together—better than they did in 1998. It's a much different environment. It's not the Wild West anymore. EE Times : How does a company build up enough trust to get established? Savage : Usually, it's the technology innovation that is the driver to make the customers make a leap—they need that specific technology that's not commoditized. Early adopters are willing to work with them in a real partnership model. Sometimes technology is not fully baked such that it needs that close cooperation to get to that maturity level. John Koeter : I think, if you're really doing complex IP, like physical IP and highly configurable IP, you have to have a certain scale to be able to build the quality into the product. Being able to afford to do that, to run all the tests and simulations and running the characterisations and split lots and get certification and so on and so forth, takes a lot. Having said that, though, there are many small IP companies that fill a vital niche. There's certainly room for many smaller companies to have a speciality that could do very well. In Warren's case, you resell other people's ideas, and they've already proven them, right? They've already put the investment in, and you've put more investment on top of it, so you can make that happen because of your unique business. Chris Rowen : I don't think that the barrier to the IP business has gotten relatively higher. It's gotten absolutely higher. But I think that's true for every area of electronic innovation. The barrier to entry for new start-ups has gone up—a lot. I think IP, particularly if it's a small team that has some unique insight into a particular vertical application domain—a particular kind of technology that may allow them to encapsulate those insights into something they can license—that's still a viable opportunity. I think we also see the emergence of new kinds of intellectual property. We're starting to see, for example, in the case of Tensilica, the ability to extend something that is already there. They can create a set of processor extensions in a standard form that plugs into our processor. Now this customer can build an entire application-specific processor without needing a compiler team, an RTOS team, a debugger team, a simulator team, a hardware team, a verification team, or models working at the next level of abstraction. A lot of that becomes automated, and it distills out just their know-how. * * * In the next installment, we will look at the areas that are most ripe for increased IP adoption. Brian Bailey EE Times  
  • 热度 22
    2013-8-29 17:50
    1757 次阅读|
    0 个评论
    This is the second instalment of an expert panel discussing the intellectual property (IP) industry. In part 1 , we tackled the concept of IP as a partnership between the supplier and the user. Taking part in this discussion are Warren Savage, president and CEO of IPextreme; John Koeter, vice president of marketing for the solutions group at Synopsys; and Chris Rowen, Cadence Fellow and CTO of Tensilica. EE Times : When the IP industry was first being formed, a lot of people would create a piece of RTL IP, hang out a shingle, and attempt to start selling it. They quickly realised that there was more to it than this. Have we moved beyond the point where this is within the realm of a start-up? Warren Savage : I don't think so. For example, we have our constellations program. It is a lot of smaller companies, very smart people with innovative ideas. There has been enough written about IP in the last 15 years, and the industry itself has matured enough such that there's been success stories written. People know how to put IP together—better than they did in 1998. It's a much different environment. It's not the Wild West anymore. EE Times : How does a company build up enough trust to get established? Savage : Usually, it's the technology innovation that is the driver to make the customers make a leap—they need that specific technology that's not commoditized. Early adopters are willing to work with them in a real partnership model. Sometimes technology is not fully baked such that it needs that close cooperation to get to that maturity level. John Koeter : I think, if you're really doing complex IP, like physical IP and highly configurable IP, you have to have a certain scale to be able to build the quality into the product. Being able to afford to do that, to run all the tests and simulations and running the characterisations and split lots and get certification and so on and so forth, takes a lot. Having said that, though, there are many small IP companies that fill a vital niche. There's certainly room for many smaller companies to have a speciality that could do very well. In Warren's case, you resell other people's ideas, and they've already proven them, right? They've already put the investment in, and you've put more investment on top of it, so you can make that happen because of your unique business. Chris Rowen : I don't think that the barrier to the IP business has gotten relatively higher. It's gotten absolutely higher. But I think that's true for every area of electronic innovation. The barrier to entry for new start-ups has gone up—a lot. I think IP, particularly if it's a small team that has some unique insight into a particular vertical application domain—a particular kind of technology that may allow them to encapsulate those insights into something they can license—that's still a viable opportunity. I think we also see the emergence of new kinds of intellectual property. We're starting to see, for example, in the case of Tensilica, the ability to extend something that is already there. They can create a set of processor extensions in a standard form that plugs into our processor. Now this customer can build an entire application-specific processor without needing a compiler team, an RTOS team, a debugger team, a simulator team, a hardware team, a verification team, or models working at the next level of abstraction. A lot of that becomes automated, and it distills out just their know-how. * * * In the next installment, we will look at the areas that are most ripe for increased IP adoption. Brian Bailey EE Times  
相关资源