{"id":408194,"date":"2024-06-29T20:00:42","date_gmt":"2024-06-29T20:00:42","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=408194"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T20:00:42","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=408194","title":{"rendered":"<span>Configuring FT4232H using the ftdi_eeprom<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/wi\/yf\/ve\/wiyfvejeoahbxqfpb_oroceji2w.png\" data-src=\"https:\/\/habrastorage.org\/webt\/wi\/yf\/ve\/wiyfvejeoahbxqfpb_oroceji2w.png\"\/><\/p>\n<p>  <\/p>\n<p>The <a href=\"https:\/\/www.ftdichip.com\/Products\/ICs\/FT4232H.htm\" rel=\"nofollow\">FT4232H<\/a> is USB 2.0 High speed to UART IC converter. The <a href=\"https:\/\/www.ftdichip.com\/Products\/ICs\/FT4232H.htm\" rel=\"nofollow\">FT4232H<\/a> has four UART ports and one USB port.<\/p>\n<p>  <\/p>\n<p>By connecting EEPROM memory to this chip, you can set specific operating modes or change the manufacturer&#8217;s data.<\/p>\n<p>  <\/p>\n<p>Let&#8217;s look at the example and configure <a href=\"https:\/\/www.ftdichip.com\/Products\/ICs\/FT4232H.htm\" rel=\"nofollow\">FT4232H<\/a> directly on a system running GNU\/Linux. We will do this using the <code>ftdi_eeprom<\/code>.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"installing-ftdi_eeprom\">Installing <code>ftdi_eeprom<\/code><\/h2>\n<p>  <\/p>\n<p>The <code>ftdi_eeprom<\/code> is part of the open-source library <a href=\"https:\/\/www.intra2net.com\/en\/developer\/libftdi\/index.php\" rel=\"nofollow\"><code>libFTDI<\/code><\/a> and depends on <a href=\"https:\/\/github.com\/libconfuse\/libconfuse\" rel=\"nofollow\"><code>libconfuse<\/code><\/a>.<\/p>\n<p>  <\/p>\n<ul>\n<li>\n<p>To install <code>ftdi_eeprom<\/code> on Ubuntu or Debian, running the following command on terminal:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">sudo apt-get update sudo apt-get install ftdi-eeprom<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>If you are preparing your own distribution using <code>Yocto Project (thud)<\/code>, <code>ftdi_eeprom<\/code> pakage can be installed by adding recipes:<\/p>\n<p>  <\/p>\n<p><code>recipes-support\/confuse\/confuse_2.7.bb<\/code> <\/p>\n<p>  <\/p>\n<pre><code class=\"python\">DESCRIPTION = \"Library for parsing configuration files.\" HOMEPAGE = \"http:\/\/www.nongnu.org\/confuse\/\" SECTION = \"libs\" LICENSE = \"ISC\" LIC_FILES_CHKSUM = \"file:\/\/NEWS;md5=18e885b42b86362019e0cab8dc2a393b\"  SRC_URI = \"http:\/\/download.savannah.gnu.org\/releases\/confuse\/confuse-${PV}.tar.gz\" SRC_URI[md5sum] = \"45932fdeeccbb9ef4228f1c1a25e9c8f\" SRC_URI[sha256sum] = \"e32574fd837e950778dac7ade40787dd2259ef8e28acd6ede6847ca895c88778\"  inherit autotools binconfig pkgconfig lib_package gettext  EXTRA_OECONF = \"--enable-shared\"  BBCLASSEXTEND = \"native\"<\/code><\/pre>\n<p>  <\/p>\n<p><code>recipes-support\/libftdi\/libftdi_%.bbappend<\/code><\/p>\n<p>  <\/p>\n<pre><code class=\"python\">PACKAGECONFIG += \"ftdi-eeprom\" PACKAGECONFIG[ftdi-eeprom] = \"-DFTDI_EEPROM=on,-DFTDI_EEPROM=off,confuse\" PACKAGES =+ \"ftdi-eeprom\" FILES_ftdi-eeprom += \"${bindir}\/ftdi_eeprom\"<\/code><\/pre>\n<p>  <\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"configuring-ft4232h\">Configuring FT4232H<\/h2>\n<p>  <\/p>\n<p>By default there are four UART ports of <a href=\"https:\/\/www.ftdichip.com\/Products\/ICs\/FT4232H.htm\" rel=\"nofollow\">FT4232H<\/a> operate in <code>RS232<\/code> mode, the manufacturer name is <code>FTDI<\/code> and the product name is <code>Quad RS232-HS<\/code>.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/c1\/ig\/pv\/c1igpvvfkud1r82cn3_1d2ghpis.png\" data-src=\"https:\/\/habrastorage.org\/webt\/c1\/ig\/pv\/c1igpvvfkud1r82cn3_1d2ghpis.png\"\/><\/p>\n<p>  <\/p>\n<p>Let&#8217;s change the manufacturer name to <code>habr.com<\/code>, the product name to <code>Quad RS485<\/code> and set for UART ports <code>RS485<\/code> operate mode.<\/p>\n<p>  <\/p>\n<p>Let&#8217;s prepare the configuration file <code>habr.conf<\/code><\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># Filename of the EE file to be generated. Leave empty to skip file writing. filename=habr.bin  # Vendor ID. FT4232H factory default 0x0403. vendor_id=0x0403  # Product ID. FT4232H factory default 0x6011. product_id=0x6011  # EEPROM Type: 0x46 for 93xx46, 0x56 for 93xx56 and 0x66 for 93xx66. eeprom_type=0x56  manufacturer=\"habr.com\" product=\"Quad RS485\" serial=\"1234\"  # Use the serial number string. use_serial=true  # Max. power consumption: value * 2 mA. Use 0 if self_powered = true. max_power=0  # Turn this off for bus powered. self_powered=true  # Turn this on for remote wakeup feature. remote_wakeup=false  # Set port operate mode. cha_type=UART chb_type=UART  # Use virtual com-port driver. cha_vcp=true chb_vcp=true chc_vcp=true chd_vcp=true  # Enable RS485 mode. cha_rs485=true chb_rs485=true chc_rs485=true chd_rs485=true <\/code><\/pre>\n<p>  <\/p>\n<p>Using the <code>ftdi_eeprom<\/code> pakage, load our configuration into EEPROM memory by running the following command on terminal:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">ftdi_eeprom --flash-eeprom habr.conf<\/code><\/pre>\n<p>  <\/p>\n<p>After rebooting the device, you can see the results of the work:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/wi\/yf\/ve\/wiyfvejeoahbxqfpb_oroceji2w.png\" data-src=\"https:\/\/habrastorage.org\/webt\/wi\/yf\/ve\/wiyfvejeoahbxqfpb_oroceji2w.png\"\/><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/531504\/\"> https:\/\/habr.com\/ru\/articles\/531504\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/wi\/yf\/ve\/wiyfvejeoahbxqfpb_oroceji2w.png\" data-src=\"https:\/\/habrastorage.org\/webt\/wi\/yf\/ve\/wiyfvejeoahbxqfpb_oroceji2w.png\"\/><\/p>\n<p>  <\/p>\n<p>The <a href=\"https:\/\/www.ftdichip.com\/Products\/ICs\/FT4232H.htm\" rel=\"nofollow\">FT4232H<\/a> is USB 2.0 High speed to UART IC converter. The <a href=\"https:\/\/www.ftdichip.com\/Products\/ICs\/FT4232H.htm\" rel=\"nofollow\">FT4232H<\/a> has four UART ports and one USB port.<\/p>\n<p>  <\/p>\n<p>By connecting EEPROM memory to this chip, you can set specific operating modes or change the manufacturer&#8217;s data.<\/p>\n<p>  <\/p>\n<p>Let&#8217;s look at the example and configure <a href=\"https:\/\/www.ftdichip.com\/Products\/ICs\/FT4232H.htm\" rel=\"nofollow\">FT4232H<\/a> directly on a system running GNU\/Linux. We will do this using the <code>ftdi_eeprom<\/code>.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-408194","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/408194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=408194"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/408194\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=408194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=408194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=408194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}