Description
What MCU/Processor/Board and compiler are you using?
I’m using FreeSoC2 development board that has CY8C5888AXI-LP096 with ARM GCC 5.4-2016-q2 compiler
What do you experience?
The code first stops at lv_task.c 135 line (lv_task_handler address: 0x000022EE), after which it goes to Cm3Start.c line 98 (IntDefaultHandler address: 0x000006D6) where is a definition of a function that goes into an infinite loop when something goes wrong. I do have to mention that when I try the same code with SSD1306 that uses I2C protocol, everything works without problems.
EDIT: Failed to mention that this is with version 6.1, and that it manages to display hello world example on display with version 5.3
What do you expect?
The same behavior as with SSD1306, that is, to display the same picture/animation, only in color of course.
Code to reproduce
I don’t know how much of the code will be of use without the whole project because I don’t know what part of code is a suspect for such behavior, and also MCU uses internal logic blocks for SPI communication that does work fine when it’s used to send commands or data for screen filling.
I can archive and upload the project for more detailed insight, but to view it, PSoC Creator is needed.
Here is the main.c file, and if needed I’ll post more code. flush_cb function is not posted since it is not reached at all.
#include "project.h"
#include "lvgl.h"
#include "lv_conf.h"
#include "ssd1306.h"
#include "SSD1331.h"
//#include "lv_tutorial_hello_world.h"
#include <stdio.h>
#define DISP_BUF_SIZE (128*64/8)
#define SSD1331_BUFF (96*64)
#define DISPLAY_ADDRESS 0x3C // 0+SA0+RW - 0x3C or 0x3D
/**********************
* FUNCTION PROTOTYPES
**********************/
void Littlev_SysTick_init(void);
void Timer_Routine(void);
static void arc_loader(lv_task_t * t);
/******************
* MAIN FUNCTION
******************/
int main(void)
{
CyGlobalIntEnable; /* Enable global interrupts. */
SSD1331_master_Start();
SSD1331_master_TxEnable();
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
I2C_Oled_Start(); /* Start the component */
/* Initialize the screen */
// lv_ssd1306_init(DISPLAY_ADDRESS);
lv_disp_init();
lv_init();
// static uint8 gbuf[DISP_BUF_SIZE]; /* SSD1306 version */
static uint8 gbuf[SSD1331_BUFF]; /* SSD1331 version */
static lv_disp_buf_t disp_buf;
// lv_disp_buf_init( &disp_buf, gbuf, NULL, LV_HOR_RES_MAX*64/8 ); /* SSD1306 version */
lv_disp_buf_init( &disp_buf, gbuf, NULL, LV_HOR_RES_MAX*64 ); /* SSD1331 version */
lv_disp_drv_t disp_drv;
lv_disp_drv_init( &disp_drv );
disp_drv.buffer = &disp_buf;
// disp_drv.flush_cb = ssd1306_flush_cb;
disp_drv.flush_cb = flush_cb;
// disp_drv.set_px_cb = set_pix_cb;
// disp_drv.rounder_cb = rounder_cb;
lv_disp_drv_register( &disp_drv );
Littlev_SysTick_init();
// lv_theme_mono_init(0, NULL);
// lv_theme_set_current( lv_theme_get_mono() );
//
/* Run the example */
// lv_tutorial_hello_world();
/* Label scrolling animation */
// lv_obj_t * label = lv_label_create(lv_scr_act(), NULL);
// lv_label_set_long_mode(label, LV_LABEL_LONG_SROLL_CIRC);
// lv_obj_set_width(label, 100);
// lv_label_set_text(label, "Long text scrolling around");
//
// //Try with and without alignment.
// lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
/*Create a style for the Preloader*/
static lv_style_t style;
lv_style_copy(&style, &lv_style_plain);
style.line.width = 1; /*10 px thick arc*/
style.line.color = LV_COLOR_BLACK; /*Blueish arc color*/
style.body.border.color = LV_COLOR_WHITE; /*Gray background color*/
style.body.border.width = 10;
style.body.padding.left = 0;
/*Create a Preloader object*/
lv_obj_t * preload = lv_preload_create(lv_scr_act(), NULL);
lv_obj_set_size(preload, 50, 50);
lv_obj_align(preload, NULL, LV_ALIGN_CENTER, 0, 0);
lv_preload_set_style(preload, LV_PRELOAD_STYLE_MAIN, &style);
// /* Create a play symbol */
// lv_obj_t * label1 = lv_label_create(lv_scr_act(), NULL);
// lv_label_set_text(label1, LV_SYMBOL_PLAY);
// lv_obj_align(label1, NULL, LV_ALIGN_IN_RIGHT_MID, 0, 0);
// /*Create style for the Arcs*/
// static lv_style_t style;
// lv_style_copy(&style, &lv_style_plain);
// style.line.color = LV_COLOR_BLACK; /*Arc color*/
// style.line.width = 1; /*Arc width*/
//
// /*Create an Arc*/
// lv_obj_t * arc = lv_arc_create(lv_scr_act(), NULL);
// lv_arc_set_style(arc, LV_ARC_STYLE_MAIN, &style); /*Use the new style*/
// lv_arc_set_angles(arc, 0, 360);
// lv_obj_set_size(arc, 64, 64);
// lv_obj_align(arc, NULL, LV_ALIGN_CENTER, 0, 0);
// /*Create style for the Arcs*/
// static lv_style_t style;
// lv_style_copy(&style, &lv_style_plain);
// style.line.color = LV_COLOR_BLACK; /*Arc color*/
// style.line.width = 1; /*Arc width*/
//
// /*Create an Arc*/
// lv_obj_t * arc = lv_arc_create(lv_scr_act(), NULL);
// lv_arc_set_angles(arc, 180, 180);
// lv_arc_set_style(arc, LV_ARC_STYLE_MAIN, &style);
// lv_obj_set_size(arc, 50, 50);
// lv_obj_align(arc, NULL, LV_ALIGN_CENTER, 0, 0);
//
// /* Create an `lv_task` to update the arc.
// * Store the `arc` in the user data*/
// lv_task_create(arc_loader, 20, LV_TASK_PRIO_LOWEST, arc);
// /* Basic animation tear testing */
//
// lv_obj_t * label = lv_label_create(lv_scr_act(), NULL);
// lv_label_set_text(label, "Ljuba homos");
// lv_obj_set_pos(label, 20, 0);
// CyDelay(300);
// lv_obj_set_pos(label, 0, 20);
// CyDelay(300);
// lv_obj_set_pos(label, 0, 22);
// lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
for(;;)
{
CyDelay(1);
lv_task_handler();
}
} /* End of Main function */
/************************
* FUNCTION DEFINITIONS
************************/
void Timer_Routine(void)
{
lv_tick_inc(1);
}
void Littlev_SysTick_init(void)
{
uint8 i ;
//
// Configure the SysTick timer to generate interrupt every 1 ms
// and start its operation.
//
CySysTickStart();
// Find unused callback slot
for (i = 0; i < CY_SYS_SYST_NUM_OF_CALLBACKS; i++)
{
if (CySysTickGetCallback(i) == NULL)
{
CySysTickSetCallback(i, Timer_Routine);
break;
}
}
}
static void arc_loader(lv_task_t * t)
{
static int16_t a = 0;
a+=5;
if(a >= 359) a = 359;
if(a < 180) lv_arc_set_angles(t->user_data, 180-a ,180);
else lv_arc_set_angles(t->user_data, 540-a ,180);
if(a == 359) {
lv_task_del(t);
return;
}
}
Screenshot and/or video
Here are some screenshots from debugger.
Up until this point everything works
and after that this is what happens
Also, if I’m missing the point or subforum please delete or move the topic
Thanks