{"id":317063,"date":"2021-01-27T21:00:20","date_gmt":"2021-01-27T21:00:20","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=317063"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=317063","title":{"rendered":"STM32F429 + IL9341 = LVGL, DOOM1"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u041d\u043e\u0432\u043e\u0433\u043e\u0434\u043d\u0438\u043c\u0438 \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a\u0430\u043c\u0438, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0430 \u0441\u0432\u043e\u0435\u0439 \u043f\u043b\u0430\u0442\u0435. \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u043f\u0440\u043e\u0432\u0435\u043b \u0442\u0435\u0441\u0442 Lvgl \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c. \u041e\u043a\u043e\u043b\u043e 20 FPF. \u0418\u043d\u043e\u0433\u0434\u0430 \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0441\u0430\u0434\u043a\u0438 \u043d\u043e \u0432 \u0446\u0435\u043b\u043e\u043c, \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f DMA \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 Chrom-<strong><em>ART<\/em><\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0441\u0442\u044c \u043d\u0430 \u0431\u043e\u0440\u0442\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u043f\u043b\u0430\u0432\u043d\u0430\u044f. ART \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c SPI. \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u043f\u0435\u0440\u0432\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043f\u0443\u0442\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u0446\u0435\u043b\u044c\u044e  \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f FPS<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6a7\/fe9\/cf3\/6a7fe9cf3e9b84ef445e528840e01707.png\" width=\"640\" height=\"740\"><figcaption><\/figcaption><\/figure>\n<hr>\n<p>\u0421\u0442\u0430\u0442\u044c\u044e \u0441\u043a\u043e\u0440\u0435\u0435 \u043d\u0430\u0434\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043b\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0446\u0435\u043b\u044f\u0445. \u042f \u043f\u0440\u0438\u0448\u0435\u043b \u043a \u0432\u044b\u0432\u043e\u0434\u0443, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0442\u043e \u043d\u0430\u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0444\u0438\u0447\u0438, \u0430 \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u0438\u0441\u043f\u044b\u0442\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0435\u043d\u0434. \u041d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Chrom-<strong><em>ART<\/em><\/strong><\/p>\n<h2>LVGL<\/h2>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c  <a href=\"https:\/\/lvgl.io\" rel=\"noopener noreferrer nofollow\">https:\/\/lvgl.io<\/a> \u0431\u044b\u043b\u043e \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u043e\u0440\u0442\u0430 \u043f\u043e\u0434 Discovery STM32F429   <a href=\"https:\/\/github.com\/lvgl\/lvportstm32f746_disco\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/lvgl\/lv<em>port<\/em>stm32f746_disco<\/a><\/p>\n<\/p>\n<p><iframe id=\"5ff78afa102304e11bb8d6ce\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/5ff78afa102304e11bb8d6ce\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0412\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u043d\u043e\u043a\u0430\u0434\u0440\u043e\u0432\u043e\u0433\u043e  \u0431\u0443\u0444\u0435\u0440\u0430 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435. \u0420\u0435\u0448\u0438\u043b \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c SDRAM. \u0422\u0443\u0442 \u043c\u0435\u043d\u044f \u0436\u0434\u0430\u043b\u043e \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0431\u0443\u0444\u0435\u0440\u0430 \u044d\u043a\u0440\u0430\u043d\u0430 \u0437\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u042d\u043a\u0440\u0430\u043d 320\u00d7240\u00d72 = 153600 \u0431\u0430\u0439\u0442 \u043d\u0430 \u0444\u0440\u044d\u0439\u043c. STM32F429 DMA \u043d\u0430 SPI \u0438\u043c\u0435\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 16 \u0431\u0438\u0442\u043d\u043e\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u0430\u0434\u0440 \u043d\u0430\u0434\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c 153600 \/ 65535 = ~2,3 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438. \u041d\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f. \u042d\u0442\u043e \u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u0443\u0442\u044b\u043b\u043e\u0447\u043d\u044b\u043c \u0433\u043e\u0440\u043b\u044b\u0448\u043a\u043e\u043c. \u041d\u0430\u0434\u043e \u0436\u0434\u0430\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043a\u0443\u0441\u043e\u043a \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0444\u0440\u044d\u0439\u043c<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3b8\/875\/646\/3b8875646c620db074cbb63a7ff55e00.jpg\" width=\"1024\" height=\"1365\"><figcaption><\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>DMA restriction 16 bit<\/summary>\n<div class=\"spoiler__content\">\n<p>There&#8217;s also an underlying hardware issue: the DMA&#8217;s NDTR (counting) register is 16-bit long.<\/p>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041d\u0438\u0436\u0435 \u0442\u043e \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 <a href=\"https:\/\/forum.lvgl.io\/t\/stm32f429-ili9341-spi\/4187\" rel=\"noopener noreferrer nofollow\">https:\/\/forum.lvgl.io\/t\/stm32f429-ili9341-spi\/4187<\/a><\/p>\n<\/p>\n<p>\u0412 \u0433\u043e\u043b\u043e\u0432\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c Double buffer. \u0412 \u043e\u0434\u043d\u043e\u043c \u0440\u0438\u0441\u0443\u0435\u043c, \u043e\u0442\u0434\u0430\u0435\u043c \u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c, \u0435\u0441\u043b\u0438 \u043e\u043d \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u043b\u0441\u044f. \u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043e\u043f\u0440\u0430\u0432\u043a\u0430 \u0441\u043c\u043e\u0442\u0440\u0438\u0442, \u0435\u0441\u0442\u044c \u043b\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0431\u0443\u0444\u0435\u0440 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044f \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443. ART \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u0412 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <a href=\"https:\/\/github.com\/floppes\/stm32doom\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/floppes\/stm32doom<\/a> \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f<\/p>\n<details class=\"spoiler\">\n<summary>lvgl forum answer<\/summary>\n<div class=\"spoiler__content\">\n<blockquote>\n<p>Your buffer setting (NULL, LV_HOR_RES_MAX * LV_VER_RES_MAX) is too high (as you already noticed by yourself&nbsp;<\/p>\n<\/p>\n<p>Normally the buffer is set around to be LV<em>HOR<\/em>RES<em>MAX * 20 (or 40, or more or less).You are using DMA. DMA in STM32F4\/7 or STM32FH7 can only handle up buffer length up to 16 bit (means 65535 bytes).<\/em><\/p>\n<\/p>\n<p><em>You set your buffer to LV<\/em>HOR<em>RES<\/em>MAX * LV<em>VER<\/em>RES_MAX. For a 320 x 240 that is 76 800.<br \/>As you have a 16-bit color values, it means 76800 * 2 = 153600 bytes. That\u2019s more than double of that what the DMA can handle at once.<br \/>As only less than a half of the necessary data is transferred to the display, frame rate gets more than doubled.<\/p>\n<\/p>\n<p>This is true if lvgl is updating the entire (or nearly the entire) display at once.<br \/>When only smaller parts of the display will be redrawn everything is ok. As the used buffer is smaller (less than the 16-bit limit of DMA).<\/p>\n<\/p>\n<p>You can of course change your flush function to split the display transfer into smaller parts,<br \/>but that will not change the overall time you need for transfer all the display data over SPI.<br \/>The bottleneck is SPI.<\/p>\n<\/p>\n<p>But with the method to have the buffer within the SDRAM (external memory), I think you will slow down lvgl.<\/p>\n<\/p>\n<p>Using the external SDRAM would make sense only when using it as a real frame buffer for display, in the case the STM32F4\/7 would use it directly for (parallel) display driving.<\/p>\n<\/p>\n<\/blockquote>\n<\/div>\n<\/details>\n<h2>\u041a\u0430\u043a \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c Doom \u0432 \u041a\u0443\u0431\u0435<\/h2>\n<\/p>\n<p>\u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u0437\u044f\u0442 \u043f\u043e\u0440\u0442 <a href=\"https:\/\/github.com\/floppes\/stm32doom\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/floppes\/stm32doom<\/a><\/p>\n<p><iframe id=\"600f28ca7c24d22e1e99f979\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/600f28ca7c24d22e1e99f979\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>https:\/\/github.com\/floppes\/stm32doom\u041f\u043e \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445. \u041d\u0430\u0434\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0438\u0441\u043a. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043e SDIO \u0447\u0435\u0440\u0435\u0437 4\u0435 \u043b\u0438\u043d\u0438\u0438. \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0430 4. \u0411\u0435\u0437 \u043d\u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u043b\u044d\u0448\u043a\u0438. \u042f \u0441\u0442\u0430\u0432\u043b\u044e \u043d\u0430 10. \u041f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u043f\u0440\u043e\u0447\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u043d\u0430\u0437\u0430\u0434.<\/p>\n<pre><code> FRESULT res = f_mount(&amp;SDFatFs, (TCHAR const*)SDPath, 1);<\/code><\/pre>\n<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0435\u043a\u0446\u0438\u044e  sdram. \u041d\u0430 \u043d\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043a\u0443\u0447\u0430. \u0422\u0430\u043a \u0436\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u0434\u043b\u044f \u043a\u0430\u043a\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c sdram \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0415\u0449\u0435 \u044f \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043b CCMRAM \u043f\u043e\u0434 \u0441\u0442\u0435\u043a<\/p>\n<pre><code>\/* Highest address of the user mode stack *\/ _estack = ORIGIN(CCMRAM) + LENGTH(CCMRAM);\t\/* end of \"RAM\" Ram type memory *\/  \/* Internal Memory Map*\/ MEMORY {   CCMRAM    (xrw)    : ORIGIN = 0x10000000,   LENGTH = 64K \trom (rx)\t: ORIGIN = 0x08000000, LENGTH = 2048K \tram (rwx)   : ORIGIN = 0x20000000, LENGTH = 192K \tsdram (rwx) : ORIGIN = 0xD004B000, LENGTH = 7892K \/* first 300K is used as LCD frame buffer *\/ }  SECTIONS  {\t \t\/* external SDRAM *\/ \t.sdram (NOLOAD) : \t{ \t\t. = ALIGN(4); \t\t*(.sdram .sdram.*) \t\tbin\/chocdoom\/i_video.o(COMMON) \t\tbin\/chocdoom\/r_bsp.o(COMMON) \t\tbin\/chocdoom\/w_wad.o(COMMON) \t\tbin\/chocdoom\/r_main.o(COMMON) \t\tbin\/chocdoom\/r_plane.o(COMMON) \t} &gt; sdram ...<\/code><\/pre>\n<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u043c \u043c\u0435\u0442\u043e\u0434 _sbrk \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u043a\u0443\u0447\u0438 \u0447\u0435\u0440\u0435\u0437 sdram. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <em>sbrk<\/em>r \u043d\u0430 \u0432\u0430\u0448\u0435 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435<\/p>\n<pre><code>#define HEAP_SIZE\t\t0x00700000 \/\/ 7 MB  \/* heap *\/ __attribute__ ((section(\".sdram\"))) static char heap[HEAP_SIZE];  caddr_t _sbrk_r (struct _reent* r, int incr) { ...<\/code><\/pre>\n<\/p>\n<p>\u0412\u0435\u0440\u0445\u0443\u0448\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0442\u0432\u0435\u0434\u0435\u043d\u0430 \u043f\u043e\u0434 \u0434\u0432\u0430 \u0431\u0443\u0444\u0435\u0440\u0430 \u044d\u043a\u0440\u0430\u043d\u0430<\/p>\n<pre><code>    sdram (rwx) : ORIGIN = 0x\u0421004B000, LENGTH = 7892K \/* first 300K is used as LCD frame buffer *\/ <\/code><\/pre>\n<\/p>\n<p>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e FMC \u043c\u043e\u0436\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u043e \u0434\u0432\u0443\u0445 \u0431\u0430\u043d\u043a\u043e\u0432, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u0431\u0430\u043d\u043a\u043e\u0432 <\/p>\n<ol>\n<li>\n<p>0x\u04210000000<\/p>\n<\/li>\n<li>\n<p>0xD0000000<\/p>\n<\/li>\n<\/ol>\n<p>\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u044d\u043a\u0440\u0430\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 i_video.c<\/p>\n<p>\u041d\u0430\u0434\u043e \u0435\u0449\u0435 \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0431\u0430\u0439\u0442\u044b, \u043d\u043e \u044f \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u0432 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0430\u043b\u0438\u0442\u0440\u044b <\/p>\n<p>\/\/ swapped = (num&gt;&gt;8) | (num&lt;&lt;8)<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0431\u044b\u043b \u043f\u043e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u043b\u0438\u043d\u0438\u0438, \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0441\u0435\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430<\/p>\n<pre><code>void I_FinishUpdate (void) {         int x, y;         byte index;          lcd_vsync = false;          for (y = 0; y &lt; SCREENHEIGHT; y++)         {                 for (x = 0; x &lt; SCREENWIDTH; x++)                 {                         index = I_VideoBuffer[y * SCREENWIDTH + x];                          ((uint16_t*)lcd_frame_buffer)[y * SCREENWIDTH + x] = rgb565_palette[index];                         \/\/ swapped = (num&gt;&gt;8) | (num&lt;&lt;8);                 } \/\/              lcd_draw_line (lcd_frame_buffer, y);         }          lcd_draw_buff (lcd_frame_buffer);         lcd_refresh ();         lcd_vsync = true; } <\/code><\/pre>\n<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0432\u043e\u0434\u0430 \u043b\u0438\u043d\u0438\u0439, \u0441\u0442\u0430\u043b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c RTOS \u0438 \u0443\u043f\u0435\u0440\u0441\u044f \u0432 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438. \u0422\u044e\u043d\u0438\u043d\u0433\u043e\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0439\u0442\u0438 \u0434\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u043a\u0438. \u041d\u043e \u043f\u043e\u0442\u043e\u043c \u0441\u0432\u0430\u043b\u0438\u0432\u0430\u043b\u0441\u044f \u0432 <strong>static<\/strong> <strong>void<\/strong> <strong>HardFault_Handler<\/strong>(<strong>void<\/strong>)<\/p>\n<p>\u0415\u0449\u0435 \u043c\u043e\u043c\u0435\u043d\u0442, \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u0430\u0432\u0442\u043e\u0440 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e Chocdoom. \u0411\u044b\u043b\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043f\u043e \u0432\u044b\u0445\u043e\u0434\u0430\u043c \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u0440\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0441\u0446\u0435\u043d\u044b. \u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e STM32F429 Discavery \u0438\u043c\u0435\u0435\u0442 2.4&#8243; QVGA TFT LCD \u0434\u0438\u0441\u043f\u043b\u0435\u0439. \u042f \u0436\u0435 \u0432\u0437\u044f\u043b 320&#215;240 SPI<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0431\u044b \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0447\u0435\u0440\u0435\u0437 DMA \u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0435 \u043d\u0430 SPI \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u041f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0441\u044b\u043b\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0431\u0443\u0444\u0435\u0440. \u0418 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0436\u0434\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e. \u041d\u043e STM32F4 \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0442\u044c 0xFFFF \u0431\u0430\u0439\u0442 \u0437\u0430 \u0440\u0430\u0437, \u0430 \u044d\u0442\u043e \u043f\u0440\u0438 \u044d\u043a\u0440\u0430\u043d\u0435 320&#215;240 \u0438 2 \u0431\u0430\u0439\u0442\u0430 \u043d\u0430 \u043f\u0438\u043a\u0441\u0435\u043b\u044c \u043d\u0430\u0434\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0431\u044b\u043b \u0441\u0434\u0435\u043b\u0430\u043d \u0441 \u043f\u043e\u0441\u044b\u043b\u043a\u043e\u0439 \u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435\u043c \u0432 3 \u044d\u0442\u0430\u043f\u0430. \u041d\u0438\u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442<\/p>\n<pre><code>void fill_display(SPI_HandleTypeDef *hspi,                 DMA_HandleTypeDef *hdma_spi_tx,                 uint8_t *buff,                 uint32_t size){          uint16_t max_transaction_size = 0xFFFF;         uint16_t send_size;         uint32_t offset = 0;         uint8_t done = 0;          HAL_GPIO_WritePin(GPIOC, DC_Pin, GPIO_PIN_SET);         HAL_GPIO_WritePin(GPIOC, CS_Pin, GPIO_PIN_RESET);          do {                  if (offset + max_transaction_size &lt;= size){                         send_size = max_transaction_size;                 } else {                         send_size = size - offset;                         done = 1;                 }                  HAL_SPI_Transmit_DMA(hspi, buff + offset, send_size);                 while (HAL_DMA_STATE_BUSY == HAL_DMA_GetState(hdma_spi_tx))                     { continue; }                 offset += max_transaction_size;          } while(done == 0);          HAL_GPIO_WritePin(GPIOC, DC_Pin, GPIO_PIN_RESET);  } <\/code><\/pre>\n<\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u043b \u0440\u0430\u0434\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430. \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0438\u043b\u0430. \u041f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 ESP32 \u0438\u0437 \u043c\u043e\u0438\u0445 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 <a href=\"https:\/\/habr.com\/ru\/post\/512130\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/post\/512130\/<\/a> \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u043f\u043e\u0431\u0435\u0436\u0430\u043b\u0430 \u044f\u0432\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435. ESP32 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b  RTOS \u043d\u043e \u0438\u043c\u0435\u043b \u043d\u0430 \u0431\u043e\u0440\u0442\u044b PSRAM \u043f\u0440\u043e\u0442\u0438\u0432 SDRAM \u0443 STM32F429. \u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u043e\u0442\u0438\u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e. \u0414\u0432\u0430 \u044f\u0434\u0440\u0430 \u0443 ESP32 \u043f\u0440\u043e\u0442\u0438\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u0443 STM32F429. STM32F429 &#171;\u043d\u0435\u043c\u043d\u043e\u0433\u043e&#187; \u0434\u043e\u0440\u043e\u0436\u0435 \u0440\u0430\u0437\u0430 \u044d\u0442\u0430\u043a \u0432 \u0434\u0432\u0430<\/p>\n<p>\u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u044f \u043d\u0430\u0447\u0430\u043b \u043f\u0440\u0438\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e Doom \u0441\u0442\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u0430\u0434\u043e\u043c \u043d\u0430 \u043f\u0435\u0440\u0435\u0434. \u0414\u0435\u043c\u043a\u0430 \u043a\u0440\u0443\u0442\u0438\u043b\u0430\u0441\u044c \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0434\u0432\u0435\u0440\u0438 \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u0441\u043f\u0438\u043d\u043e\u0439..<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0431\u044b\u043b \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d<\/p>\n<\/p>\n<details class=\"spoiler\">\n<summary>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u043f\u043e \u0442\u0435\u043c\u0435<\/summary>\n<div class=\"spoiler__content\">\n<p>Graphic memory optimization with STM32 Chrom-GRC\u2122<\/p>\n<p><a href=\"Graphic%20memory%20optimization%20with%20STM32%20Chrom-GRC%E2%84%A2\" rel=\"noopener noreferrer nofollow\"><abbr title=\"Graphic memory optimization with STM32 Chrom-GRC\u2122\">https:\/\/www.st.com\/resource\/en\/application_note\/dm00407777-graphic-memory-optimization-with-stm32-chrom-grc-stmicroelectronics.pdf<\/abbr><\/a><\/p>\n<\/p>\n<p><a href=\"https:\/\/github.com\/ardnew\/ILI9341-STM32-HAL\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/ardnew\/ILI9341-STM32-HAL<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/afiskon\/stm32-ili9341\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/afiskon\/stm32-ili9341<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/martnak\/STM32-ILI9341\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/martnak\/STM32-ILI9341<\/a><\/p>\n<\/div>\n<\/details>\n<h2>\u0412 \u043f\u043b\u0430\u043d\u0430\u0445<\/h2>\n<p>\u0412 \u043f\u043b\u0430\u043d\u0430\u0445 \u0441\u043e\u0431\u0440\u0430\u0442\u044c STM32F750x8. \u041d\u0430 \u0431\u043e\u0440\u0442\u0443 \u0443 \u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e 64K flash \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 flash \u043f\u0430\u043c\u044f\u0442\u0438. \u0420\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u0439 \u0431\u044e\u0434\u0436\u0435\u0442\u043d\u044b\u0439 STM32F7<\/p>\n<blockquote>\n<p><strong>3.9 Quad-SPI memory interface (QUADSPI) <\/strong><\/p>\n<\/p>\n<p>All devices embed a Quad-SPI memory interface, which is a specialized communication interface targeting Single, Dual or Quad-SPI Flash memories. It can work in: <\/p>\n<p>\u2022 Direct mode through registers. <\/p>\n<p>\u2022 External flash status register polling mode. <\/p>\n<p>\u2022 Memory mapped mode. Up to 256 Mbytes external flash are memory mapped, supporting 8, 16 and 32-bit access.<strong> Code execution is supported.<\/strong> The opcode and the frame format are fully programmable. Communication can be either in Single Data Rate or Dual Data Rate.<\/p>\n<\/blockquote>\n<p><strong>Code execution is supported<\/strong> &#8212; Hello ESP32!<\/p>\n<\/p>\n<p>\u0421\u0445\u0435\u043c\u0430 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0435\u043b\u044c\u044f<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/339\/0b4\/35d\/3390b435d87ac8a28f1a85e3e2ce21ae.png\" width=\"2338\" height=\"1653\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<p> \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\/post\/536424\/\"> https:\/\/habr.com\/ru\/post\/536424\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u041d\u043e\u0432\u043e\u0433\u043e\u0434\u043d\u0438\u043c\u0438 \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a\u0430\u043c\u0438, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0430 \u0441\u0432\u043e\u0435\u0439 \u043f\u043b\u0430\u0442\u0435. \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u043f\u0440\u043e\u0432\u0435\u043b \u0442\u0435\u0441\u0442 Lvgl \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c. \u041e\u043a\u043e\u043b\u043e 20 FPF. \u0418\u043d\u043e\u0433\u0434\u0430 \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0441\u0430\u0434\u043a\u0438 \u043d\u043e \u0432 \u0446\u0435\u043b\u043e\u043c, \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f DMA \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 Chrom-<strong><em>ART<\/em><\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0441\u0442\u044c \u043d\u0430 \u0431\u043e\u0440\u0442\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u043f\u043b\u0430\u0432\u043d\u0430\u044f. ART \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c SPI. \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u043f\u0435\u0440\u0432\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043f\u0443\u0442\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u0446\u0435\u043b\u044c\u044e  \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f FPS<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<hr>\n<p>\u0421\u0442\u0430\u0442\u044c\u044e \u0441\u043a\u043e\u0440\u0435\u0435 \u043d\u0430\u0434\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043b\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0446\u0435\u043b\u044f\u0445. \u042f \u043f\u0440\u0438\u0448\u0435\u043b \u043a \u0432\u044b\u0432\u043e\u0434\u0443, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0442\u043e \u043d\u0430\u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0444\u0438\u0447\u0438, \u0430 \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u0438\u0441\u043f\u044b\u0442\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0435\u043d\u0434. \u041d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 Chrom-<strong><em>ART<\/em><\/strong><\/p>\n<h2>LVGL<\/h2>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c  <a href=\"https:\/\/lvgl.io\" rel=\"noopener noreferrer nofollow\">https:\/\/lvgl.io<\/a> \u0431\u044b\u043b\u043e \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u043e\u0440\u0442\u0430 \u043f\u043e\u0434 Discovery STM32F429   <a href=\"https:\/\/github.com\/lvgl\/lvportstm32f746_disco\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/lvgl\/lv<em>port<\/em>stm32f746_disco<\/a><\/p>\n<\/p>\n<p><iframe id=\"5ff78afa102304e11bb8d6ce\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/5ff78afa102304e11bb8d6ce\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>\u0412\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u043d\u043e\u043a\u0430\u0434\u0440\u043e\u0432\u043e\u0433\u043e  \u0431\u0443\u0444\u0435\u0440\u0430 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435. \u0420\u0435\u0448\u0438\u043b \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c SDRAM. \u0422\u0443\u0442 \u043c\u0435\u043d\u044f \u0436\u0434\u0430\u043b\u043e \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0431\u0443\u0444\u0435\u0440\u0430 \u044d\u043a\u0440\u0430\u043d\u0430 \u0437\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u042d\u043a\u0440\u0430\u043d 320\u00d7240\u00d72 = 153600 \u0431\u0430\u0439\u0442 \u043d\u0430 \u0444\u0440\u044d\u0439\u043c. STM32F429 DMA \u043d\u0430 SPI \u0438\u043c\u0435\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 16 \u0431\u0438\u0442\u043d\u043e\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u0430\u0434\u0440 \u043d\u0430\u0434\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c 153600 \/ 65535 = ~2,3 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438. \u041d\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f. \u042d\u0442\u043e \u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u0443\u0442\u044b\u043b\u043e\u0447\u043d\u044b\u043c \u0433\u043e\u0440\u043b\u044b\u0448\u043a\u043e\u043c. \u041d\u0430\u0434\u043e \u0436\u0434\u0430\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043a\u0443\u0441\u043e\u043a \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0444\u0440\u044d\u0439\u043c<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>DMA restriction 16 bit<\/summary>\n<div class=\"spoiler__content\">\n<p>There&#8217;s also an underlying hardware issue: the DMA&#8217;s NDTR (counting) register is 16-bit long.<\/p>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041d\u0438\u0436\u0435 \u0442\u043e \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 <a href=\"https:\/\/forum.lvgl.io\/t\/stm32f429-ili9341-spi\/4187\" rel=\"noopener noreferrer nofollow\">https:\/\/forum.lvgl.io\/t\/stm32f429-ili9341-spi\/4187<\/a><\/p>\n<\/p>\n<p>\u0412 \u0433\u043e\u043b\u043e\u0432\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c Double buffer. \u0412 \u043e\u0434\u043d\u043e\u043c \u0440\u0438\u0441\u0443\u0435\u043c, \u043e\u0442\u0434\u0430\u0435\u043c \u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c, \u0435\u0441\u043b\u0438 \u043e\u043d \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u043b\u0441\u044f. \u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043e\u043f\u0440\u0430\u0432\u043a\u0430 \u0441\u043c\u043e\u0442\u0440\u0438\u0442, \u0435\u0441\u0442\u044c \u043b\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0431\u0443\u0444\u0435\u0440 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044f \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443. ART \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u0412 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <a href=\"https:\/\/github.com\/floppes\/stm32doom\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/floppes\/stm32doom<\/a> \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f<\/p>\n<details class=\"spoiler\">\n<summary>lvgl forum answer<\/summary>\n<div class=\"spoiler__content\">\n<blockquote>\n<p>Your buffer setting (NULL, LV_HOR_RES_MAX * LV_VER_RES_MAX) is too high (as you already noticed by yourself&nbsp;<\/p>\n<\/p>\n<p>Normally the buffer is set around to be LV<em>HOR<\/em>RES<em>MAX * 20 (or 40, or more or less).You are using DMA. DMA in STM32F4\/7 or STM32FH7 can only handle up buffer length up to 16 bit (means 65535 bytes).<\/em><\/p>\n<\/p>\n<p><em>You set your buffer to LV<\/em>HOR<em>RES<\/em>MAX * LV<em>VER<\/em>RES_MAX. For a 320 x 240 that is 76 800.<br \/>As you have a 16-bit color values, it means 76800 * 2 = 153600 bytes. That\u2019s more than double of that what the DMA can handle at once.<br \/>As only less than a half of the necessary data is transferred to the display, frame rate gets more than doubled.<\/p>\n<\/p>\n<p>This is true if lvgl is updating the entire (or nearly the entire) display at once.<br \/>When only smaller parts of the display will be redrawn everything is ok. As the used buffer is smaller (less than the 16-bit limit of DMA).<\/p>\n<\/p>\n<p>You can of course change your flush function to split the display transfer into smaller parts,<br \/>but that will not change the overall time you need for transfer all the display data over SPI.<br \/>The bottleneck is SPI.<\/p>\n<\/p>\n<p>But with the method to have the buffer within the SDRAM (external memory), I think you will slow down lvgl.<\/p>\n<\/p>\n<p>Using the external SDRAM would make sense only when using it as a real frame buffer for display, in the case the STM32F4\/7 would use it directly for (parallel) display driving.<\/p>\n<\/p>\n<\/blockquote>\n<\/div>\n<\/details>\n<h2>\u041a\u0430\u043a \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c Doom \u0432 \u041a\u0443\u0431\u0435<\/h2>\n<\/p>\n<p>\u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u0437\u044f\u0442 \u043f\u043e\u0440\u0442 <a href=\"https:\/\/github.com\/floppes\/stm32doom\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/floppes\/stm32doom<\/a><\/p>\n<p><iframe id=\"600f28ca7c24d22e1e99f979\" src=\"https:\/\/embedd.srv.habr.com\/iframe\/600f28ca7c24d22e1e99f979\" class=\"embed_video embed__content\" allowfullscreen=\"true\"><\/iframe><\/p>\n<p>https:\/\/github.com\/floppes\/stm32doom\u041f\u043e \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445. \u041d\u0430\u0434\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0438\u0441\u043a. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043e SDIO \u0447\u0435\u0440\u0435\u0437 4\u0435 \u043b\u0438\u043d\u0438\u0438. \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0430 4. \u0411\u0435\u0437 \u043d\u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u043b\u044d\u0448\u043a\u0438. \u042f \u0441\u0442\u0430\u0432\u043b\u044e \u043d\u0430 10. \u041f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u043f\u0440\u043e\u0447\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0447\u0430\u0441\u0442\u043e\u0442\u0443 \u043d\u0430\u0437\u0430\u0434.<\/p>\n<pre><code> FRESULT res = f_mount(&amp;SDFatFs, (TCHAR const*)SDPath, 1);<\/code><\/pre>\n<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0435\u043a\u0446\u0438\u044e  sdram. \u041d\u0430 \u043d\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043a\u0443\u0447\u0430. \u0422\u0430\u043a \u0436\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u0434\u043b\u044f \u043a\u0430\u043a\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c sdram \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0415\u0449\u0435 \u044f \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043b CCMRAM \u043f\u043e\u0434 \u0441\u0442\u0435\u043a<\/p>\n<pre><code>\/* Highest address of the user mode stack *\/ _estack = ORIGIN(CCMRAM) + LENGTH(CCMRAM);\t\/* end of \"RAM\" Ram type memory *\/  \/* Internal Memory Map*\/ MEMORY {   CCMRAM    (xrw)    : ORIGIN = 0x10000000,   LENGTH = 64K \trom (rx)\t: ORIGIN = 0x08000000, LENGTH = 2048K \tram (rwx)   : ORIGIN = 0x20000000, LENGTH = 192K \tsdram (rwx) : ORIGIN = 0xD004B000, LENGTH = 7892K \/* first 300K is used as LCD frame buffer *\/ }  SECTIONS  {\t \t\/* external SDRAM *\/ \t.sdram (NOLOAD) : \t{ \t\t. = ALIGN(4); \t\t*(.sdram .sdram.*) \t\tbin\/chocdoom\/i_video.o(COMMON) \t\tbin\/chocdoom\/r_bsp.o(COMMON) \t\tbin\/chocdoom\/w_wad.o(COMMON) \t\tbin\/chocdoom\/r_main.o(COMMON) \t\tbin\/chocdoom\/r_plane.o(COMMON) \t} &gt; sdram ...<\/code><\/pre>\n<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u043c \u043c\u0435\u0442\u043e\u0434 _sbrk \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u043a\u0443\u0447\u0438 \u0447\u0435\u0440\u0435\u0437 sdram. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <em>sbrk<\/em>r \u043d\u0430 \u0432\u0430\u0448\u0435 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435<\/p>\n<pre><code>#define HEAP_SIZE\t\t0x00700000 \/\/ 7 MB  \/* heap *\/ __attribute__ ((section(\".sdram\"))) static char heap[HEAP_SIZE];  caddr_t _sbrk_r (struct _reent* r, int incr) { ...<\/code><\/pre>\n<\/p>\n<p>\u0412\u0435\u0440\u0445\u0443\u0448\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043e\u0442\u0432\u0435\u0434\u0435\u043d\u0430 \u043f\u043e\u0434 \u0434\u0432\u0430 \u0431\u0443\u0444\u0435\u0440\u0430 \u044d\u043a\u0440\u0430\u043d\u0430<\/p>\n<pre><code>    sdram (rwx) : ORIGIN = 0x\u0421004B000, LENGTH = 7892K \/* first 300K is used as LCD frame buffer *\/ <\/code><\/pre>\n<\/p>\n<p>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e FMC \u043c\u043e\u0436\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u043e \u0434\u0432\u0443\u0445 \u0431\u0430\u043d\u043a\u043e\u0432, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u0431\u0430\u043d\u043a\u043e\u0432 <\/p>\n<ol>\n<li>\n<p>0x\u04210000000<\/p>\n<\/li>\n<li>\n<p>0xD0000000<\/p>\n<\/li>\n<\/ol>\n<p>\u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u044d\u043a\u0440\u0430\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 i_video.c<\/p>\n<p>\u041d\u0430\u0434\u043e \u0435\u0449\u0435 \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0431\u0430\u0439\u0442\u044b, \u043d\u043e \u044f \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b \u0432 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0430\u043b\u0438\u0442\u0440\u044b <\/p>\n<p>\/\/ swapped = (num&gt;&gt;8) | (num&lt;&lt;8)<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0431\u044b\u043b \u043f\u043e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u043b\u0438\u043d\u0438\u0438, \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0441\u0435\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430<\/p>\n<pre><code>void I_FinishUpdate (void) {         int x, y;         byte index;          lcd_vsync = false;          for (y = 0; y &lt; SCREENHEIGHT; y++)         {                 for (x = 0; x &lt; SCREENWIDTH; x++)                 {                         index = I_VideoBuffer[y * SCREENWIDTH + x];                          ((uint16_t*)lcd_frame_buffer)[y * SCREENWIDTH + x] = rgb565_palette[index];                         \/\/ swapped = (num&gt;&gt;8) | (num&lt;&lt;8);                 } \/\/              lcd_draw_line (lcd_frame_buffer, y);         }          lcd_draw_buff (lcd_frame_buffer);         lcd_refresh ();         lcd_vsync = true; } <\/code><\/pre>\n<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0432\u043e\u0434\u0430 \u043b\u0438\u043d\u0438\u0439, \u0441\u0442\u0430\u043b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c RTOS \u0438 \u0443\u043f\u0435\u0440\u0441\u044f \u0432 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438. \u0422\u044e\u043d\u0438\u043d\u0433\u043e\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0439\u0442\u0438 \u0434\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u043a\u0438. \u041d\u043e \u043f\u043e\u0442\u043e\u043c \u0441\u0432\u0430\u043b\u0438\u0432\u0430\u043b\u0441\u044f \u0432 <strong>static<\/strong> <strong>void<\/strong> <strong>HardFault_Handler<\/strong>(<strong>void<\/strong>)<\/p>\n<p>\u0415\u0449\u0435 \u043c\u043e\u043c\u0435\u043d\u0442, \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u0430\u0432\u0442\u043e\u0440 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e Chocdoom. \u0411\u044b\u043b\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043f\u043e \u0432\u044b\u0445\u043e\u0434\u0430\u043c \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u0440\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0441\u0446\u0435\u043d\u044b. \u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e STM32F429 Discavery \u0438\u043c\u0435\u0435\u0442 2.4&#8243; QVGA TFT LCD \u0434\u0438\u0441\u043f\u043b\u0435\u0439. \u042f \u0436\u0435 \u0432\u0437\u044f\u043b 320&#215;240 SPI<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0431\u044b \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0447\u0435\u0440\u0435\u0437 DMA \u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0435 \u043d\u0430 SPI \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u041f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0441\u044b\u043b\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0431\u0443\u0444\u0435\u0440. \u0418 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0436\u0434\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e. \u041d\u043e STM32F4 \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0442\u044c 0xFFFF \u0431\u0430\u0439\u0442 \u0437\u0430 \u0440\u0430\u0437, \u0430 \u044d\u0442\u043e \u043f\u0440\u0438 \u044d\u043a\u0440\u0430\u043d\u0435 320&#215;240 \u0438 2 \u0431\u0430\u0439\u0442\u0430 \u043d\u0430 \u043f\u0438\u043a\u0441\u0435\u043b\u044c \u043d\u0430\u0434\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0431\u044b\u043b \u0441\u0434\u0435\u043b\u0430\u043d \u0441 \u043f\u043e\u0441\u044b\u043b\u043a\u043e\u0439 \u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435\u043c \u0432 3 \u044d\u0442\u0430\u043f\u0430. \u041d\u0438\u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442<\/p>\n<pre><code>void fill_display(SPI_HandleTypeDef *hspi,                 DMA_HandleTypeDef *hdma_spi_tx,                 uint8_t *buff,                 uint32_t size){          uint16_t max_transaction_size = 0xFFFF;         uint16_t send_size;         uint32_t offset = 0;         uint8_t done = 0;          HAL_GPIO_WritePin(GPIOC, DC_Pin, GPIO_PIN_SET);         HAL_GPIO_WritePin(GPIOC, CS_Pin, GPIO_PIN_RESET);          do {                  if (offset + max_transaction_size &lt;= size){                         send_size = max_transaction_size;                 } else {                         send_size = size - offset;                         done = 1;                 }                  HAL_SPI_Transmit_DMA(hspi, buff + offset, send_size);                 while (HAL_DMA_STATE_BUSY == HAL_DMA_GetState(hdma_spi_tx))                     { continue; }                 offset += max_transaction_size;          } while(done == 0);          HAL_GPIO_WritePin(GPIOC, DC_Pin, GPIO_PIN_RESET);  } <\/code><\/pre>\n<\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u043b \u0440\u0430\u0434\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430. \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0438\u043b\u0430. \u041f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 ESP32 \u0438\u0437 \u043c\u043e\u0438\u0445 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 <a href=\"https:\/\/habr.com\/ru\/post\/512130\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/post\/512130\/<\/a> \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u043f\u043e\u0431\u0435\u0436\u0430\u043b\u0430 \u044f\u0432\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435. ESP32 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b  RTOS \u043d\u043e \u0438\u043c\u0435\u043b \u043d\u0430 \u0431\u043e\u0440\u0442\u044b PSRAM \u043f\u0440\u043e\u0442\u0438\u0432 SDRAM \u0443 STM32F429. \u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u043e\u0442\u0438\u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e. \u0414\u0432\u0430 \u044f\u0434\u0440\u0430 \u0443 ESP32 \u043f\u0440\u043e\u0442\u0438\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u0443 STM32F429. STM32F429 &#171;\u043d\u0435\u043c\u043d\u043e\u0433\u043e&#187; \u0434\u043e\u0440\u043e\u0436\u0435 \u0440\u0430\u0437\u0430 \u044d\u0442\u0430\u043a \u0432 \u0434\u0432\u0430<\/p>\n<p>\u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u044f \u043d\u0430\u0447\u0430\u043b \u043f\u0440\u0438\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e Doom \u0441\u0442\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u0430\u0434\u043e\u043c \u043d\u0430 \u043f\u0435\u0440\u0435\u0434. \u0414\u0435\u043c\u043a\u0430 \u043a\u0440\u0443\u0442\u0438\u043b\u0430\u0441\u044c \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0434\u0432\u0435\u0440\u0438 \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u0441\u043f\u0438\u043d\u043e\u0439..<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0431\u044b\u043b \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d<\/p>\n<\/p>\n<details class=\"spoiler\">\n<summary>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u043f\u043e \u0442\u0435\u043c\u0435<\/summary>\n<div class=\"spoiler__content\">\n<p>Graphic memory optimization with STM32 Chrom-GRC\u2122<\/p>\n<p><a href=\"Graphic%20memory%20optimization%20with%20STM32%20Chrom-GRC%E2%84%A2\" rel=\"noopener noreferrer nofollow\"><abbr title=\"Graphic memory optimization with STM32 Chrom-GRC\u2122\">&#171;>https:\/\/www.st.com\/resource\/en\/application_note\/dm00407777-graphic-memory-optimization-with-stm32-chrom-grc-stmicroelectronics.pdf<\/abbr><\/a><\/p>\n<\/p>\n<p><a href=\"https:\/\/github.com\/ardnew\/ILI9341-STM32-HAL\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/ardnew\/ILI9341-STM32-HAL<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/afiskon\/stm32-ili9341\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/afiskon\/stm32-ili9341<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/martnak\/STM32-ILI9341\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/martnak\/STM32-ILI9341<\/a><\/p>\n<\/div>\n<\/details>\n<h2>\u0412 \u043f\u043b\u0430\u043d\u0430\u0445<\/h2>\n<p>\u0412 \u043f\u043b\u0430\u043d\u0430\u0445 \u0441\u043e\u0431\u0440\u0430\u0442\u044c STM32F750x8. \u041d\u0430 \u0431\u043e\u0440\u0442\u0443 \u0443 \u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e 64K flash \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 flash \u043f\u0430\u043c\u044f\u0442\u0438. \u0420\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u0439 \u0431\u044e\u0434\u0436\u0435\u0442\u043d\u044b\u0439 STM32F7<\/p>\n<blockquote>\n<p><strong>3.9 Quad-SPI memory interface (QUADSPI) <\/strong><\/p>\n<\/p>\n<p>All devices embed a Quad-SPI memory interface, which is a specialized communication interface targeting Single, Dual or Quad-SPI Flash memories. It can work in: <\/p>\n<p>\u2022 Direct mode through registers. <\/p>\n<p>\u2022 External flash status register polling mode. <\/p>\n<p>\u2022 Memory mapped mode. Up to 256 Mbytes external flash are memory mapped, supporting 8, 16 and 32-bit access.<strong> Code execution is supported.<\/strong> The opcode and the frame format are fully programmable. Communication can be either in Single Data Rate or Dual Data Rate.<\/p>\n<\/blockquote>\n<p><strong>Code execution is supported<\/strong> &#8212; Hello ESP32!<\/p>\n<\/p>\n<p>\u0421\u0445\u0435\u043c\u0430 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0435\u043b\u044c\u044f<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<p> \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\/post\/536424\/\"> https:\/\/habr.com\/ru\/post\/536424\/<\/a><br \/><\/br><\/br><\/p>\n<\/blockquote>\n<\/div>\n<\/details>\n<\/hr>\n<\/div>\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-317063","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/317063","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=317063"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/317063\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=317063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=317063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=317063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}