Jump to content

Constantine

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by Constantine

  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.
  16. Joel, I tried as you recommended. That is the error: ... Src/usbd_desc.o: In function `gfxInit': D:\MY_WORKS\STM_projects\STM_HYDROFILTER_Eclipse_uGFX\Debug/./../ugfx/src/gfx.c:84: multiple definition of `gfxInit' ... And some other useless warnings (not from uGFX library).
  17. Hello, Joel. I tried several approaches, but Eclipse/GCC environment is pretty capricious, and in most cases I catch different errors while building. Only this reached success: Add uGFX: 1. Copy 'uGFX' library folder to your Eclipse project folder 2. Add 'uGFX' to C/C++ Build pathes: Properties for $Your_project -> C/C++ Build -> Settings -> Tool Settings -> Includes add next pathes: ../ugfx ../ugfx/src 3. Copy 'gfx_mk.c' to '$Your_project/Src from ugfx/src' 4. Copy 'gfxconf.h' to '$Your_project/Inc' and config it. 5. Add next inclusions in 'main.c': #include "gfx.h" #include "gfxconf.h" -- Most common errors is: "redefinition of gfxInit ..." Later I will try again approach that you have offered, maybe I will find some solution. B.R. Constantine.
  18. Could somebody place this words in the frame at the enterance of this site: Manual How to implement uGFX lib in existing Eclipse project with autotool makefile. Copy ugfx lib folder to your Eclipse project tree and exclude it from build( click right button on folder and choose Resource Configurations). Copy gfx_mk.c to your src from ugfx/src. Now all necessary sources and headers of ugfx include to build. Copy gfxconf.h to your include dir and config it. Choose or create necessary drivers and board files (BSP). You can choose them from ugfx/drivers and ugfx/boards. Copy necessary folders to your project tree and check including them to build. For example, f7-discovery(LCD + Touch Screen) requires folowing drivers: ugfx/drivers/gdisp/STM32LTDC and ugfx/drivers/ginput/touch/FT5336. Also you can take something usefull from board files ugfx/boards/base/STM32F746-Discovery Specify following include paths: "../ugfx""../dviver1 folder""../dviver2 folder""../board folder" Thanks a lot Victor its working.
  19. I like you guys! I always think the same: #define Magenta Fuchsia even if everybody say that this is not.
  20. YES! I just replace all mess code that is shipped with library (look file 'gdisp_lld_ILI9325.c') and everithing works!!! Dear uGFX command. I'm not recommending you provide hardware code for LCD controllers. It is a way of errors. Take code that I provided to you.
  21. I'm trying to initialize display with ILI9325 and I've found that this is impossible. I begin to check this driver and found completely strange initialization sequence. Code is complete mess - no register names, no values clues. Pretty bad programming style. Did anybody had a success with this controller and uGFX's driver? I have mine initialization routine, that works perfect by itself and with emWin. Look attachment. LCD_hardware_routines_ILI_9325.h LCD_hardware_routines_ILI_9325.c
  22. Hello guys!) Could somebody clearly explain what these two functions should do: systemticks_t gfxSystemTicks(void){} and systemticks_t gfxMillisecondsToTicks(delaytime_t ms){} /* I'm using STM32 MCU with its awkward-to-handle HAL. And trying to build bare hardware)) project from this article: https://wiki.ugfx.io/index.php/Using_Keil_µVision_5_MDK-ARM */ In HAL this function: HAL_GetTick() returns ticks, One tick == one millisecond. It is obvious from this code - look file stm32fXxx_hal.c: ** * @brief This function provides accurate delay (in milliseconds) based * on variable incremented. * @note In the default implementation , SysTick timer is the source of time base. * It is used to generate interrupts at regular time intervals where uwTick * is incremented. * @note ThiS function is declared as __weak to be overwritten in case of other * implementations in user file. * @param Delay: specifies the delay time length, in milliseconds. * @retval None */ __weak void HAL_Delay(__IO uint32_t Delay) { uint32_t tickstart = 0; tickstart = HAL_GetTick(); while((HAL_GetTick() - tickstart) < Delay) { } } It will be the same for any STM32 MCU. So I try to implement it like this: systemticks_t gfxSystemTicks(void){ return ((systemticks_t)(HAL_GetTick())); } systemticks_t gfxMillisecondsToTicks(delaytime_t ms){ return ((systemticks_t)ms); } Because I suppose that 'gfxSystemTicks' provides system time for GUI library. And 'gfxMillisecondsToTicks' converts some mysterious internal GUI ticks into millisecond. I can compare this with emWin - there was just one variable 'extern volatile GUI_TIMER_TIME OS_TimeMS;' that you should increment every millisecond. It serves for emWin like a command to refresh screen. B.R. Constantine
  23. Hello, uGFX team. Is it possible to find some manual about your library in some printable view? I prefer PDF, but will be glad to any type. Most of my programming skills I received from Moscow metro. Every day I spend aprox. 3 hours in metro, and all this time I'm reading some special literature. That is how I study emWin, FreeRTOS and NIOS II. It will be very helpful to have uGFX manual in printable view. If it didn't created yet, I have some advise how it should look like. This manual shouldn't be comprehensive review of all library including source code. Just theory of operation, some examples and brief API description. All this aprox. on 300 - 500 pages, not more. B.R. Constantine.
×
×
  • Create New...