Stm usb vcp drivers mac os

STM32 на MAC OS

Как то раз я понял, что для реализации моей идеи мне не обойтись одними транзисторами и самодельными RS тригерами, и пора начинать работать с микроконтроллерами.

В микроконтроллерах я к сожалению абсолютный ноль, и мне пришлось начать гуглить и читать кучу статей. Спустя некоторое время, когда стала ясна разница между архитектурой Фон Неймана и Гарвардской, и другими базовыми вещами, нужно было выбрать микроконтроллер с которым я буду работать.

Из-за простоты необходимых мне возможностей я остановился на PIC, но коллега вовремя наставил меня на путь праведный и сказал копать в сторону STM и AVR, так как себестоимость не на много больше а возможности на порядок выше.

И вскоре я приобрел отладочную плату STM32F4 Discovery kit for STM32F407

В первый день носился с ней по дому и радовался как мигают LEDы и работает гироскоп. Но пора бы начать и самому писать программы. После 30 минут гугления я понял что 95% решений описанных в интернете работают под Windows, а счастливые обладатели Linux и Mac OS гуляют лесом. Я провел 3 дня по вечерам в поисках решений и в итоге имеем полный мануал как начать программировать под STM32 под Mac OS.

Сначала необходимо поставить среду разработки. В нашем случае это будет Eclipse(Indigo R Eclipse IDE for C/C++ Developers Mac Cocoa 64-bit). Идем по ссылке Eclipse качаем и устанавливаем.

GNU ARM toolchain

Можно скачать с официального сайта http://www.gnuarm.com/files.html. Но почему то при попытке запуска arm-elf-gcc или arm-elf-g++ возникает ошибка — Bad CPU type in executable. Почему? Я ещё не разобрался. Поэтому даю ссылочку на мой fork репозитория arm.

Давайте его выкачаем — git clone github.com/jsnyder/arm-eabi-toolchain.git
Теперь надо поставить все необходимые пакеты — brew install mpfr gmp libmpc texinfo
Далее идем выкачанную директорию — cd arm-eabi-toolchain
И выполняем:
mkdir -p $HOME/arm-cs-tools/bin
export PATH=$HOME/arm-cs-tools/bin:$PATH
CC=clang make cross-binutils cross-gcc cross-g++ cross-newlib
make cross-gdb
export PATH=$HOME/arm-cs-tools/bin:$PATH
make clean

ST-LINK

Идем сюда качаем и устанавливаем как написано в README. Тут можно почитать по дебагер ST-LINK.

Настройка

Теперь начинаем все связывать воедино.
Запускаем Eclipse. Идем в Help -> Install New Software. Нажимаем ссылку Available Software Sites. Находим CDT Juno, ставим галочку и жмем OK. Теперь в поле Work with выбираем CDT Juno. В появившемся списке ищем GCC Cross Compiler, ставим галочку а потом кнопку Finish.

Теперь мы можем создать нужный нам проект.
Идем в File -> New -> C++ Project. Выбираем Executable Cross Compile Project, даем ему имя и нажимаем Finish.

Теперь у нас есть пустой проект и нужно его настроить.
Выбираем наш проект, нажимаем правой кнопкой и идем в Properties -> C/C++ Build -> Settings.
В Cross GCC Assembler -> General -> Assembler flags пишем -mthumb -mcpu=cortex-m4
В Cross GCC Compiler -> Miscellaneous -> Other flags пишем -c -mthumb -mcpu=cortex-m4
В Cross G++ Compiler -> Miscellaneous -> Other flags пишем -c -mthumb -mcpu=cortex-m4
В Cross GCC Linker -> Miscellaneous -> Linker flags пишем:
-T «$/stm32_flash.ld» -mthumb -mcpu=cortex-m4 -Wl,-Map=linker.map -Wl,-cref -Wl,—gc-sections

Читайте также:  Лучший офисный пакет для линукс

Теперь после компиляции получим бинарный файл в нужном виде. Для этого тут же в настройках выбираем таб Build Steps и в поле Command пишем
arm-none-eabi-objcopy -I ihex «$» «$.ihex»

Базовый проект

Здесь качаем базовый проект. В нем описано чтобы отладочная борда умела мигать светодиодами.
После того как вы скачаете и поместите все файлы в проект Eclipse. Нужно указать пути к подключаемым заголовкам. Опять же идем в Properties -> C/C++ Build -> Settings.
Тут у Cross GCC Compiler и Cross G++ Compiler в Includes добавляем
«$/inc/STM32F4xx_StdPeriph_Driver/inc>»
«$/inc/STM32F4xx_StdPeriph_Driver/src>»
«$/inc/CMSIS>»
«$/inc/STM32F4xx>»
«$/inc>»

и жмём OK.

Поехали

Вроде все. Привязывать st-link и gdb к eclipse я не стал. Поэтому покажу как все делается из консоли.

В Eclipse собираем наш проект кнопочкой Build.
После того как убедились что сборка успешная и бинарный файлик тоже есть, подключаем нашу плату через USB.

Открываем консоль (лучше iterm). В первом табе запускаем st-link. После установки он должен быть доступен глобально.

2013-12-05T22:48:22 INFO src/stlink-common.c: Loading device parameters…
2013-12-05T22:48:22 INFO src/stlink-common.c: Device connected is: F4 device, id 0x10016413
2013-12-05T22:48:22 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytes
Chip ID is 00000413, Core ID is 2ba01477.
Target voltage is 2879 mV.
Listening at *:4242.

Мы видим как определяется устройство и вешается обработчик на порт 4242.

В соседней вкладке запускаем ранее установленный arm-none-eabi-gdb

GNU gdb (32-bit ARM EABI Toolchain JBS-2013.05-23-v2013.05-1-gd66a29f) 7.4.50.20120716-cvs
Copyright © 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type «show copying»
and «show warranty» for details.
This GDB was configured as «—host=x86_64-apple-darwin12.5.0 —target=arm-none-eabi».
For bug reporting instructions, please see:
.
(gdb)

Все отлично. Теперь необходимо подключиться к нашему девайсу. Нужно выполнить команду target remote :4242

(gdb) target remote :4242
Remote debugging using :4242
0x08000b70 in ?? ()

В соседней вкладке где запущен st-link мы дожны увидеть инфу о подключении GDB

KARL — should read back as 0x03, not 60 02 00 00
GDB connected.

Ну и осталось послследнее. Нужно накатить нашу новую прошивку.
Идем во вкладку с GDB и выполняем команду load

(gdb) load путь_к_бинарнику_.ihex
Loading section .sec1, size 0xc10 lma 0x8000000
Start address 0x8000b70, load size 3088
Transfer rate: 3 KB/sec, 3088 bytes/write.

А в соседней вкладке отладчика будет видно что все успешно накатилось

2013-12-05T22:56:04 INFO src/stlink-common.c: Attempting to write 16384 (0x4000) bytes to stm32 address: 134217728 (0x8000000)
EraseFlash — Sector:0x0 Size:0x4000
Flash page at addr: 0x08000000 erased
2013-12-05T22:56:05 INFO src/stlink-common.c: Finished erasing 1 pages of 16384 (0x4000) bytes
2013-12-05T22:56:05 INFO src/stlink-common.c: Starting Flash write for F2/F4
2013-12-05T22:56:05 INFO src/stlink-common.c: Successfully loaded flash loader in sram
size: 16384
2013-12-05T22:56:05 INFO src/stlink-common.c: Starting verification of write complete
2013-12-05T22:56:05 INFO src/stlink-common.c: Flash written and verified! jolly good!

Чтобы посмотреть на результат, в gdb выполните команду ‘c’ (continue). Плата должна замигать как новогодняя ёлка.

Читайте также:  Canon laserbase mf5770 windows 10

Всё о чем я писал не имеет 100% понимания с моей стороны. Но это отличная отправная точка для начинающих.
Надеюсь эта статья поможет кому-нибудь.

Источник

Stm usb vcp drivers mac os

This page contains the VCP drivers currently available for FTDI devices.

For D2XX Direct drivers, please click here .

Installation guides are available from the Installation Guides page of the Documents section of this site for selected operating systems.

VCP Drivers
Virtual COM port (VCP) drivers cause the USB device to appear as an additional COM port available to the PC. Application software can access the USB device in the same way as it would access a standard COM port.

This software is provided by Future Technology Devices International Limited «as is» and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall future technology devices international limited be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
FTDI drivers may be used only in conjunction with products based on FTDI parts.
FTDI drivers may be distributed in any form as long as license information is not modified.
If a custom vendor ID and/or product ID or description string are used, it is the responsibility of the product manufacturer to maintain any changes and subsequent WHCK re-certification as a result of making these changes.
For more detail on FTDI Chip Driver licence terms, please click here.

Currently Supported VCP Drivers:

Processor Architecture
Operating System Release Date x86 (32-bit) x64 (64-bit) PPC ARM MIPSII MIPSIV SH4 Comments
Windows* 201 7 — 0 8-30 2.12.28 2.12.28 WHQL Certified. Includes VCP and D2XX.
Available as a setup executable
Please read the Release Notes and Installation Guides.
Linux All FTDI devices now supported in Ubuntu 11.10, kernel 3.0.0-19
Refer to TN-101 if you need a custom VCP VID/PID in Linux
VCP drivers are integrated into the kernel.
Mac OS X 10.3 to 10.8 2012-08-10 2.2.18 2.2.18 2.2.18 Refer to TN-105 if you need a custom VCP VID/PID in MAC OS
Mac OS X 10.9 and above 20 20 — 08 — 13 2.4.4 This driver is signed by Apple
Windows CE 4.2-5.2** 2012-01-0 6 1.1.0.20 1.1.0.20 1.1.0.10 1.1.0.10 1.1.0.10
Windows CE 6.0/7.0 2016-11-03 1.1.0.22
CE 6.0 CAT
CE 7.0 CAT
1.1.0.22
CE 6.0 CAT
CE 7.0 CAT
1.1.0.10 1.1.0.10 1.1.0.10 For use of the CAT files supplied for ARM and x86 builds refer to AN_319
Windows CE 2013 2015-03-06 1.0.0 1.0.0 VCP Driver Support for WinCE2013
Читайте также:  Редактор линукс vi как выйти

*Includes the following version of of the Windows operating system: Windows 7, Windows Server 2008 R2 and Windows 8, 8.1, Windows server 2012 R2, Windows Server 2016 and Windows 10. Also, as Windows 8 RT is a closed system not allowing for 3rd party driver installation our Windows 8 driver will not support this variant of the OS. You must use the Windows RT build for this platform.

**includes the following versions of Windows CE 4.2-5.2 based operating systems: Windows Mobile 2003, Windows Mobile 2003 SE, Windows Mobile 5, Windows Mobile 6, Windows Mobile 6.1 ,Windows Mobile 6.5

No Longer Supported:

Processor Architecture
Operating System Release Date x86 (32-bit) x64 (64-bit) PPC ARM MIPSII MIPSIV SH4 Comments
Previous Windows Release 2017-03-10 2.12.26 2.12.26 WHQL Certified. Includes VCP and D2XX.
Available as a setup executable
Please read the Release Notes and Installation Guides.
Windows XP, Vista, Server 2003, Server 2008 2012-04-13 2.08.24 2.08.24 WHQL Certified
Also available as a setup executable
Release notes
This is FTDI’s final release before Microsoft stopped certifying drivers for these versions of Windows.
Windows 2000 2009-10-22 2.06.00 WHQL Certified
Available as setup executable
Release notes
Windows 98/ME 2004-11-25 1.09.06 Does not support FT2232 or FT4232 devices
Windows 98/ME 2004-03-12 1.0.3 Only supports FT2232D devices
Mac OS 9
Mac OS 8
2004-05-18 1.0f4
Mac OS X 10.9 and above 20 15 -0 4 -1 5 2.3 This driver is signed by Apple
Linux 2009-05-14 1.5.0 1.5.0

© Future Technology Devices International Ltd.

Источник

Оцените статью