Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


LWIP_HTTPD_CUSTOM_FILES

Hi

I’m developing a small project on stm32f407 to show logs file written on sdcard using raw lwip. I’ve enabled:

LWIP_HTTPD_CUSTOM_FILES
LWIP_HTTPD_DYNAMIC_FILE_READ

but I’ve some problems to implements these methods:

int fs_open_custom(struct fs_file *file, const char *name);
void fs_close_custom(struct fs_file *file);
int fs_read_custom(struct fs_file *file, char *buffer, int count);

any ideas?

thank you,

Andrea

here is my starting code:

//open custom file
int fs_open_custom(struct fs_file *file, const char *name) {

//open log file
if(strncmp_url(name,”/log_file.txt”,13)>0)
{
file->data = “buffer_open_custom”;
file->len = 1000;
file->index = 0;
file->pextension = NULL;
file->is_custom_file = 1;

//0 if unable to open
return 1;
}
}

//read file and fill “buffer” step by step by “count” bytes amount
int fs_read_custom(struct fs_file *file, char *buffer, int count) {

int read = 0;
if (file->index < file->len)
{
read = 100;
file->is_custom_file = 1;
buffer = “buffer_read_custom”;
}
else
{
//end reached
read = FS_READ_EOF;
}
return read;
}

void fs_close_custom(struct fs_file *file){

//close file
//f_close(&fileOpen);

}

fs_open_custom works ok and the first part of the page is correctly loaded, then fs_read_custom is called 10 times before return FS_READ_EOF but only the first call appends to the buffer “buffer_read_custom” string, next calls append only part of “fsdata_custom.c” file. Any idea about this behavior? This is only a proof of concept example. I just need to test this code works correctly


 

Newest Forum Posts

  1. emerald casino online i240jx by StephenNug, 2026-02-27 00:08
  2. milkyway online casino games b28sos by StephenNug, 2026-02-25 10:25
  3. casino blacklist online i72xxd by StephenNug, 2026-02-23 20:11
  4. best online casinos canada reddit a57fpx by StephenNug, 2026-02-23 19:01
  5. hollywood casino online blackjack p271nq by StephenNug, 2026-02-22 21:12
  6. three card poker online casino y82gxs by StephenNug, 2026-02-22 20:34
  7. sugarhouse online casino pa j13lyy by StephenNug, 2026-02-22 03:56
  8. casino online latvia f40blg by StephenNug, 2026-02-21 19:10
  9. casinos online reviews a94tvt by StephenNug, 2026-02-21 09:22
  10. royal ace online casino no deposit bonus codes u60dqh by StephenNug, 2026-02-20 20:00

Last-Modified Blogs