Jump to content

AnSc

Members
  • Posts

    20
  • Joined

  • Last visited

  1. Hi, sorry for the delay, was busy elsewhere… Please find attached the diff of my changes. gdisp_lld_SSD1322.diff
  2. Hi, thanks for this tip. As I wrote it was a crude first try. I changed the macro to this: #define xyaddr(x, y) ((x/2) + (y)*SSD1322_ROW_WIDTH) and did see the same correct behaviour after reverting the code line to: ram = RAM(g)+xyaddr(x,y);
  3. Yes this is right. Currently it works as expected on my side. Thanks for asking.
  4. Ok, I think I fixed it now: Summary of all required changes:
  5. Fonts look like the high and low Half-Byte are swapped:
  6. After quite some back and forth I got my debugger running again. Looks like it did not like to work on my USB hub… Used another USB and now it seems to work more reliably. I found this thread here: Then I added gdispFlush() to my code and voilla, line is displayed. I find the documentation on that a bit lagging. This was not obvious from the examples I found. However, maybe due to my crude hack, the line is a bit jagged:
  7. After my initial euphoria I'm now stuck using the library as such. Below is my code in my thread and it does not send any data to the display after initialization. I attached an oscilloscope to the chip select line and would expect to see data transfer to the display every 500 ms. But there is nothing. What am I missing?
  8. As a quick test I just made a crude change to the code: This does give me a nice picture of the uGFX logo for a short period after reset. No crash.
  9. After playing with the numbers: The end of the allocated block is at 0x20004FA8. The calculation with the numbers from the affected code lines gives (0x20002FA8+(255+63*128)) = 0x20005027 The difference is 0x20005027-0x20004FA8 = 127 This does not look like a random number. So where do those extra 127 come from? It looks to me like x is too big. ROW_WIDTH is SCREEN_WIDTH/2 and this value is used to allocate the memory: Is'nt it then necessary to reflect this requirement also when trying to access the "framebuffer" for each pixel?
  10. I had an error in my calculation which Giovanni from ChibiOS pointed out: So the allocated memory is fine. But somehow the graphics driver goes beyond that. Where do I need to fix the code so that this does not happen any more?
  11. Just found out that g->priv is a return from chHeapAlloc(). Therefore ChibiOS should raise an error in my opinion since the requested heap size results in an end address beyond RAM end. Not sure what's happening there.
  12. I thought about this a bit last night. I don't understand how uGFX handles this "framebuffer" if this is what it is. From my limited understanding of the code in gdisp_lld_SSD1322.c (lines 216, 217) it looks to me like some "random" pointer somewhere into the RAM and not into some "reserved" area because of the "on-the-fly" calculation. There is no function call involved or I didn't get it. How is there a safe-guard that this does not try to access non-RAM area or RAM area that other code uses? ram = RAM(g)+xyaddr(x,y); *ram &= ~xybits(x, y, LLDCOLOR_MASK()); Is there any working project (stub) that uses this display on this controller? So I could try to run this and compare to my code to exclude things on my end that may contribute to this error?
  13. Currently it works, but no promises as how long.
  14. Addition: this is the state of various variables when it fails. g->priv is well within the memory range. So why does ram = RAM(g)+xyaddr(x,y); end up in such a high region?
  15. Thanks for helping me. I pushed my code to github: https://github.com/transistorgrab/RT_HPS_STM32F103 This is the output from a clean build: 17:20:48 **** Build of configuration Default for project RT_HPS_STM32F103 **** make -j all Compiling crt0_v7m.S Compiling vectors.S Compiling chcoreasm.S Compiling crt1.c Compiling hal.c Compiling hal_st.c Compiling hal_buffers.c Compiling hal_queues.c Compiling hal_flash.c Compiling hal_mmcsd.c Compiling hal_adc.c Compiling hal_gpt.c Compiling hal_i2c.c Compiling hal_pal.c Compiling hal_pwm.c Compiling hal_serial.c Compiling hal_serial_usb.c Compiling hal_spi.c Compiling hal_usb.c Compiling nvic.c Compiling stm32_isr.c Compiling hal_lld.c Compiling hal_efl_lld.c Compiling hal_adc_lld.c Compiling stm32_dma.c Compiling hal_pal_lld.c Compiling hal_i2c_lld.c Compiling hal_spi_v2_lld.c Compiling hal_st_lld.c Compiling hal_gpt_lld.c Compiling hal_pwm_lld.c Compiling hal_serial_lld.c Compiling hal_usb_lld.c Compiling board.c Compiling osal.c Compiling chsys.c Compiling chrfcu.c Compiling chdebug.c Compiling chtrace.c Compiling chvt.c Compiling chschd.c Compiling chinstances.c Compiling chthreads.c Compiling chtm.c Compiling chregistry.c Compiling chsem.c Compiling chmtx.c Compiling chcond.c Compiling chevents.c Compiling chmsg.c Compiling chdynamic.c Compiling chmboxes.c Compiling chmemcore.c Compiling chmemheaps.c Compiling chmempools.c Compiling chpipes.c Compiling chobjcaches.c Compiling chdelegates.c Compiling chfactory.c Compiling chcore.c Compiling chprintf.c Compiling chscanf.c Compiling memstreams.c Compiling nullstreams.c Compiling bufstreams.c Compiling gfx.c Compiling gos_chibios.c Compiling gos_freertos.c Compiling gos_win32.c Compiling gos_linux.c Compiling gos_osx.c Compiling gos_raw32.c Compiling gos_ecos.c Compiling gos_rawrtos.c Compiling gos_arduino.c Compiling gos_cmsis.c Compiling gos_zephyr.c Compiling gos_nios.c Compiling gos_x_threads.c Compiling gos_x_heap.c Compiling gdriver.c Compiling gqueue.c ./uGFX/src/gos/gos_x_threads.c:10:5: warning: "GOS_NEED_X_THREADS" is not defined, evaluates to 0 [-Wundef] 10 | #if GOS_NEED_X_THREADS | ^~~~~~~~~~~~~~~~~~ Compiling gdisp.c Compiling gdisp_fonts.c ./uGFX/src/gos/gos_x_heap.c:10:5: warning: "GOS_NEED_X_HEAP" is not defined, evaluates to 0 [-Wundef] 10 | #if GOS_NEED_X_HEAP | ^~~~~~~~~~~~~~~ Compiling gdisp_pixmap.c Compiling gdisp_image.c Compiling gdisp_image_native.c Compiling gdisp_image_gif.c Compiling gdisp_image_bmp.c Compiling gdisp_image_jpg.c Compiling gdisp_image_png.c Compiling mf_encoding.c Compiling mf_font.c Compiling mf_justify.c Compiling mf_kerning.c Compiling mf_rlefont.c Compiling mf_bwfont.c Compiling mf_scaledfont.c Compiling mf_wordwrap.c Compiling gevent.c Compiling gtimer.c Compiling gwin.c Compiling gwin_widget.c Compiling gwin_wm.c Compiling gwin_console.c Compiling gwin_graph.c Compiling gwin_button.c Compiling gwin_slider.c Compiling gwin_image.c Compiling gwin_checkbox.c Compiling gwin_label.c Compiling gwin_radio.c Compiling gwin_progressbar.c Compiling gwin_list.c Compiling gwin_container.c Compiling gwin_frame.c Compiling gwin_tabset.c Compiling gwin_gl3d.c Compiling gwin_keyboard.c Compiling gwin_keyboard_layout.c Compiling gwin_textedit.c Compiling ginput.c Compiling ginput_mouse.c Compiling ginput_keyboard.c Compiling ginput_keyboard_microcode.c Compiling ginput_toggle.c Compiling ginput_dial.c Compiling gadc.c Compiling gaudio.c Compiling gmisc.c Compiling gmisc_arrayops.c Compiling gmisc_matrix2d.c Compiling gmisc_trig.c Compiling gmisc_hittest.c Compiling gfile.c Compiling gfile_fs_native.c Compiling gfile_fs_ram.c Compiling gfile_fs_rom.c Compiling gfile_fs_fatfs.c Compiling gfile_fs_petitfs.c Compiling gfile_fs_mem.c Compiling gfile_fs_chibios.c Compiling gfile_fs_strings.c Compiling gfile_printg.c Compiling gfile_scang.c Compiling gfile_stdio.c Compiling gfile_fatfs_wrapper.c Compiling gfile_fatfs_diskio_chibios.c Compiling gfile_petitfs_wrapper.c Compiling gfile_petitfs_diskio_chibios.c Compiling gtrans.c Compiling gdisp_lld_SSD1322.c Compiling main.c In file included from main.c:21: oled.c:8:34: warning: 'rxbuf' defined but not used [-Wunused-variable] 8 | CC_ALIGN_DATA(32) static uint8_t rxbuf[128]; | ^~~~~ Linking build/ch.elf lto-wrapper.exe: warning: Options to Xassembler do not match: -alms=./build/lst/crt1.lst, -alms=./build/lst/hal.lst, dropping all -Xassembler and -Wa options. Creating build/ch.hex Creating build/ch.bin Creating build/ch.dmp Creating build/ch.list text data bss dec hex filename 38536 0 20480 59016 e688 build/ch.elf Done 17:21:09 Build Finished. 0 errors, 3 warnings. (took 20s.472ms)
×
×
  • Create New...