Jump to content

Constantine

Members
  • Posts

    27
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Sorry, but I couldn't find another solution how to include your library in Eclipse project. I tried many approaches. Maybe. But in my case, I had found the required parameters before understood what these scripts are doing.
  2. I understand that this is some kind of piggery, but is it some image resize mechanism in library? B.R. Constantine.
  3. I found solution. Protect 'disk_read' function: DRESULT disk_read(BYTE lun, BYTE *buff, DWORD sector, UINT count) { DRESULT res = RES_OK; #if FREERTOS_IS_USED taskENTER_CRITICAL(); #endif if (BSP_SD_ReadBlocks((uint32_t*) buff, (uint64_t) (sector * BLOCK_SIZE), BLOCK_SIZE, count) != MSD_OK) res = RES_ERROR; #if FREERTOS_IS_USED taskEXIT_CRITICAL(); osDelay(1); #endif return res; }
  4. And some final question. Cause I protected whole drawing function: taskENTER_CRITICAL(); received_img_error = gdispImageDraw(&myImage, 0, 0, image_width, image_height, 0, 0); taskEXIT_CRITICAL(); As you see, while image is in drawing process, all other threads are stopped, cause scheduler is freezed. As I could understand, function 'gdispImageDraw' loads image to display line by line (the same mechanism as in emWin), so for my purposes it will be more suitable to protect just SD reading process, not whole function. How can I implement such behavior? B.R. Constantine.
  5. GUYS I LOVE YOU!!!! SO MUCH!!!! IT CYCLING IMAGES WITHOUT ANY TROUBLES!!!!! NO MEMORY RUN OUTS STACK OVERFLOWS OR OTHER STUPID EMWIN ERRORS: http://forum.segger.com/index.php?page=Thread&postID=12479#post12479
  6. The same trouble as with emWin. User should protect image drawing process: taskENTER_CRITICAL(); received_img_error = gdispImageDraw(&myImage, 0, 0, 300, 225, 0, 0); taskEXIT_CRITICAL(); More details on emWin's forum: http://forum.segger.com/index.php?page=Thread&postID=12505#post12505
  7. Ok guys, finally I wrote my IO functions for your FATFS, and its working. But I couldn't use external to uGFX FATFS lib, and this definitely a bug. Hope you will fix it. Will see what shows next tests. B.R. Constantine.
  8. Nothing for. I'm sitting and waiting for reply for my other post. Show image from SD: B.R. Constantine.
  9. My main function (CubeMX generated): int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration----------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_DMA_Init(); MX_FSMC_Init(); MX_SPI2_Init(); MX_ADC1_Init(); MX_CRC_Init(); MX_SDIO_SD_Init(); MX_USART2_UART_Init(); MX_USART1_UART_Init(); /* USER CODE BEGIN 2 */ Create_threads(); /* USER CODE END 2 */ /* Call init function for freertos objects (in freertos.c) */ MX_FREERTOS_Init(); /* Start scheduler */ osKernelStart(); /* We should never get here as control is now taken by the scheduler */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ } 'Create thread' function: void Create_threads(void) { osThreadDef(GUI_task, GUI_thread, osPriorityNormal, 0, 1024); //define thread GUITaskHandle = osThreadCreate(osThread(GUI_task), NULL); //create thread - id shouldn't be equal 0x0 osThreadDef(Image_cycler_task, Image_cycler_thread, osPriorityNormal, 0, 1024); //define thread ImageCyclerTaskHandle = osThreadCreate(osThread(Image_cycler_task), NULL); //create thread - id shouldn't be equal 0x0 if ((GUITaskHandle == 0x0) || (ImageCyclerTaskHandle == 0x0)) Error_Handler(); } Threads: void GUI_thread(void const * argument) { gfxInit(); #if GFX_USE_GDISP && GDISP_NEED_TEXT font_t font = gdispOpenFont("ISOCPEUR Regular 20"); gwinSetDefaultFont(font); #if (DISPLAY_ORIENTATION == 0) gdispSetOrientation(GDISP_ROTATE_0); #elif(DISPLAY_ORIENTATION == 90) gdispSetOrientation(GDISP_ROTATE_90); #elif(DISPLAY_ORIENTATION == 180) gdispSetOrientation(GDISP_ROTATE_180); #elif(DISPLAY_ORIENTATION == 270) gdispSetOrientation(GDISP_ROTATE_270); #endif //DISPLAY_ORIENTATION /*From FATFS*/ // FIL ImgFile; // FRESULT res; // FATFS fileSystem; /*Debug*/ char buffer[64] = { 0 }; /*From uGFX*/ gdispImageError received_error; GFILE* imgFile; coord_t swidth = 320, sheight = 240; static gdispImage myImage; // MX_FATFS_Init(); // if (f_mount(&fileSystem, (TCHAR const*) SD_Path, 0) == FR_OK) { //FATFS mount drive /*Test for file existence*/ // res = f_open(&ImgFile, file_name[0], FA_OPEN_EXISTING | FA_READ); // f_close(&ImgFile); /*End test for file existence*/ imgFile = gfileOpen(file_name[0], "rb"); received_error = gdispImageOpenGFile(&myImage, imgFile); gdispImageDraw(&myImage, 0, 0, swidth, sheight, 0, 0); gdispImageClose(&myImage); // } gdispFillArea(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, Blue); sprintf(buffer, "Received error %x", (int) received_error); gdispDrawString(0, 0, buffer, font, White); gdispDrawString(0, 20, "Запущено!!!", font, White); // CreateGUI(); #endif //GFX_USE_GDISP && GDISP_NEED_TEXT for (;;) { gfxSleepMilliseconds(500); } } void Image_cycler_thread(void const * argument) { (void) argument; for (;;){ gfxSleepMilliseconds(500); HAL_GPIO_TogglePin(LED2_GPIO_Port, LED2_Pin); } } main.c main.h gfxconf.h RTOS_functions.h RTOS_functions.c MyGUI.h MyGUI.c
  10. I tested FATFS again and it's working: My code for such test is the next: /*From FATFS*/ FIL ImgFile; FRESULT res; FATFS fileSystem; /*Debug*/ char buffer[64] = { 0 }; /*From uGFX*/ gdispImageError received_error; GFILE* imgFile; coord_t swidth = 320, sheight = 240; static gdispImage myImage; MX_FATFS_Init(); if (f_mount(&fileSystem, (TCHAR const*) SD_Path, 0) == FR_OK) { //FATFS mount drive /*Test for file existence*/ res = f_open(&ImgFile, file_name[0], FA_OPEN_EXISTING | FA_READ); f_close(&ImgFile); /*End test for file existence*/ imgFile = gfileOpen(file_name[0], "rb"); received_error = gdispImageOpenGFile(&myImage, imgFile); gdispImageDraw(&myImage, 0, 0, swidth, sheight, 0, 0); gdispImageClose(&myImage); } gdispFillArea(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, Blue); sprintf(buffer, "Received error %x", (int) received_error); gdispDrawString(0, 0, buffer, font, White); gdispDrawString(0, 20, "Запущено!!!", font, White);
  11. Hi, Joel I did as you asked. I have next error: GDISP_IMAGE_ERR_NOSUCHFILE I divided my code a little, as you can see: gdispImageError received_error; GFILE* imgFile; coord_t swidth = 320, sheight = 240; FATFS fileSystem; static gdispImage myImage; MX_FATFS_Init(); if (f_mount(&fileSystem, (TCHAR const*) SD_Path, 0) == FR_OK) { //FATFS mount drive imgFile = gfileOpen(file_name[0], "rb"); received_error = gdispImageOpenGFile(&myImage, imgFile); gdispImageDraw(&myImage, 0, 0, swidth, sheight, 0, 0); gdispImageClose(&myImage); } But I tried booth approaches, with the same result. B.R. Constantine.
  12. Hello, Joel. I tested these options. I found it in 'gfile_options.h' but couldn't found it in 'gfxconf.h'. So I added these options by myself - my 'GFILE' section looks like: /////////////////////////////////////////////////////////////////////////// // GFILE // /////////////////////////////////////////////////////////////////////////// #define GFX_USE_GFILE TRUE #define GFILE_FATFS_EXTERNAL_LIB TRUE #define GFILE_PETITFS_EXTERNAL_LIB TRUE //#define GFILE_NEED_PRINTG FALSE //#define GFILE_NEED_SCANG FALSE //#define GFILE_NEED_STRINGS FALSE //#define GFILE_NEED_FILELISTS FALSE //#define GFILE_NEED_STDIO FALSE //#define GFILE_NEED_NOAUTOMOUNT FALSE //#define GFILE_NEED_NOAUTOSYNC FALSE //#define GFILE_NEED_MEMFS TRUE //#define GFILE_NEED_ROMFS FALSE //#define GFILE_NEED_RAMFS FALSE //#define GFILE_NEED_FATFS TRUE //#define GFILE_NEED_NATIVEFS FALSE //#define GFILE_NEED_CHBIOSFS FALSE //#define GFILE_ALLOW_FLOATS FALSE //#define GFILE_ALLOW_DEVICESPECIFIC FALSE //#define GFILE_MAX_GFILES 3 After that I tried to implement this code: char* file_name[] = { "1_300x225_16bpp.bmp", "2_300x225_16bpp.bmp", "3_300x225_16bpp.bmp", "4_300x225_16bpp.bmp", "5_300x225_16bpp.bmp", "6_300x225_16bpp.bmp", "7_300x225_16bpp.bmp", "8_300x225_16bpp.bmp", "9_300x225_16bpp.bmp", "10_300x225_16bpp.bmp", "11_300x225_16bpp.bmp", "12_300x225_16bpp.bmp", "13_300x225_16bpp.bmp", "14_300x225_16bpp.bmp", "15_300x225_16bpp.bmp", }; static gdispImage myImage; FATFS fileSystem; FIL ImgFile; void GUI_thread(void const * argument) { gfxInit(); #if GFX_USE_GDISP && GDISP_NEED_TEXT font_t font = gdispOpenFont("ISOCPEUR Regular 20"); gwinSetDefaultFont(font); #if (DISPLAY_ORIENTATION == 0) gdispSetOrientation(GDISP_ROTATE_0); #elif(DISPLAY_ORIENTATION == 90) gdispSetOrientation(GDISP_ROTATE_90); #elif(DISPLAY_ORIENTATION == 180) gdispSetOrientation(GDISP_ROTATE_180); #elif(DISPLAY_ORIENTATION == 270) gdispSetOrientation(GDISP_ROTATE_270); #endif //DISPLAY_ORIENTATION coord_t swidth = 320, sheight = 240; // Set up IO for our image MX_FATFS_Init(); if (f_mount(&fileSystem, (TCHAR const*) SD_Path, 0) == FR_OK) { gdispImageOpenFile(&myImage, file_name[0]); gdispImageDraw(&myImage, 0, 0, swidth, sheight, 0, 0); gdispImageClose(&myImage); } gdispFillArea(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, Blue); gdispDrawString(0, 0, "Initialized!", font, White); gdispDrawString(0, 20, "Запущено!!!", font, White); CreateGUI(); #endif //GFX_USE_GDISP && GDISP_NEED_TEXT for (;;) { gfxSleepMilliseconds(500); } } I mounted SD successfully (as always, STM's CubeMX FATFS implementation works pretty reliable). But after i tried to fill 'gdispImage' structure, it doesn't happen - look for screenshot: No hardfault, no any errors, it just not loads. Can you give me some tip how to resolve this issue? I understand, that in case of using uGFX FATFS library I should write complete driver to access SD card through SDIO, and I don't want to do it, especially when this job had made already by STM's engineers. B.R. Constantine.
  13. 1) I looked inside 'gfx_mk.c', and all what I've found is several file definitions. From your previous post: I'm not sure that you change file names for every new library release. On present moment it looks pretty stable. 2) I successfully build GUI under FreeRTOS based on your library in Eclipse. Tomorrow I'll try to describe whole process on my site. 3) SSD1963 driver pretty good. I changed nothing in code, except 'board' porting. 3.1) I think this is useless: #define CALC_PERIOD(w,b,f,p) (p+b+w+f) #define CALC_FPR(w,h,hb,hf,hp,vb,vf,vp,fps) ((fps * CALC_PERIOD(w,hb,hf,hp) * CALC_PERIOD(h,vb,vf,vp) * 1048576)/100000000)
  14. If you worked in Eclipse for a long time, you should know that its errors not really mirroring what really happens))
  15. Yes, Joel, absolutely. It is pretty obvious in Eclipse, in project explorer you see all files of your Project directory.
×
×
  • Create New...