Author Topic: Repurpose a Single Use Libero CB temperature logger  (Read 1411 times)

0 Members and 1 Guest are viewing this topic.

Offline monthlybasil

  • Contributor
  • Posts: 7
  • Country: au
Repurpose a Single Use Libero CB temperature logger
« on: September 30, 2022, 12:51:42 am »
I have a single use temperature logger, that is apparently useless when it has been received at the delivery location and read by plugging it in.

Not happy at this piece having no further use, I wanted to see if there is another purpose for this. So I opened it up and removed the battery to try and reset it. No dice. It still displayed Stop.

I tried holding the start stop button while inserting the battery and bLdr is displayed. Plugging it in now, instead of showing the compiled PDF, shows an empty folder.

I'm assuming that, provided a new firmware file at this stage, the temperature logger could be customised and then used to check if the fridge has stopped running while on holidays, log min and max temps, and maybe something awesome that I haven't thought of yet.

I'm out of my depth and need the next step.

Any ideas or assistance is appreciated.

[attachimg=1]
[attachimg=2]
[attachimg=3]
[attachimg=4]
[attachimg=5]
 

Online eutectique

  • Regular Contributor
  • *
  • Posts: 160
  • Country: be
Re: Repurpose a Single Use Libero CB temperature logger
« Reply #1 on: September 30, 2022, 04:50:08 am »
Quote
Plugging it in now, instead of showing the compiled PDF, shows an empty folder.

Can you create an empty pdf file there?
 
The following users thanked this post: Fraser, monthlybasil

Offline monthlybasil

  • Contributor
  • Posts: 7
  • Country: au
Re: Repurpose a Single Use Libero CB temperature logger
« Reply #2 on: September 30, 2022, 05:27:48 am »
I didn't want to try anything just yet, I'm assuming bLdr is shorthand for bootloader, so either that's when it can be programmed, either with a .bin or a suitable piece of software.

But I suppose if I can get it to bootloader I can do pretty much anything, because I can get it back to this point and try again?

I was going to try a 'blink' firmware, that flashes each segment on the LCD one by one.

Is this arduino ide level? Or do I need to make it in platformIO or something else? I've not messed with these ICs before.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 11849
Re: Repurpose a Single Use Libero CB temperature logger
« Reply #3 on: September 30, 2022, 05:34:17 am »
I agree 'bLdr' probably stands for boot-loader, i.e. its expecting new firmware.  It may be looking for a firmware file to be written to the mass storage device it presents as, possibly encrypted and/or in a proprietary format, or it may expect it over some other interface, connected via pogo pins to the test pads on the underside of the PCB.

If you study the datasheet of the STM32L073CZT6 MCU, and do a bit of research you can probably figure out how to wipe the chip and get it into a more standard bootloader mode so you can use your own firmware.  If you haven't done STM32 development previously you've got a long steep road ahead of you!  It certainly isn't going to be as easy as adding a new board to the Arduino IDE, as there don't seem to be any using that specific MCU.
 
The following users thanked this post: monthlybasil

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 1917
  • Country: gb
Re: Repurpose a Single Use Libero CB temperature logger
« Reply #4 on: September 30, 2022, 09:46:41 am »
There's a chance that the oem firmware displays 'bLdr' and then jumps to the built-in STM32 usb dfu bootloader.
Might be worth trying stm32 dFuSe.
 
The following users thanked this post: monthlybasil

Online eutectique

  • Regular Contributor
  • *
  • Posts: 160
  • Country: be
Re: Repurpose a Single Use Libero CB temperature logger
« Reply #5 on: September 30, 2022, 10:37:46 am »
Is this arduino ide level? Or do I need to make it in platformIO or something else? I've not messed with these ICs before.

If you followed Microcontrollers section for a couple of past days, you've probably noticed three discussions dedicated to tools:

https://www.eevblog.com/forum/microcontrollers/lets-discuss-telluriums-tutorial/
https://www.eevblog.com/forum/microcontrollers/rant-why-i-dumped-platform-io-ide-after-a-week/
https://www.eevblog.com/forum/microcontrollers/is-st-cube-ide-a-piece-of-buggy-crap/
« Last Edit: September 30, 2022, 12:47:03 pm by eutectique »
 
The following users thanked this post: monthlybasil

Offline ozcar

  • Frequent Contributor
  • **
  • Posts: 269
  • Country: au
Re: Repurpose a Single Use Libero CB temperature logger
« Reply #6 on: September 30, 2022, 08:03:11 pm »
If you study the datasheet of the STM32L073CZT6 MCU, and do a bit of research you can probably figure out how to wipe the chip and get it into a more standard bootloader mode so you can use your own firmware.  If you haven't done STM32 development previously you've got a long steep road ahead of you!  It certainly isn't going to be as easy as adding a new board to the Arduino IDE, as there don't seem to be any using that specific MCU.

The "official STM32DUINO" core does include an entry for "Generic L073CZYx" - should be "close enough".
 
The following users thanked this post: Ian.M, monthlybasil

Offline monthlybasil

  • Contributor
  • Posts: 7
  • Country: au
Re: Repurpose a Single Use Libero CB temperature logger
« Reply #7 on: October 02, 2022, 05:15:39 am »
Here's what I have so far.

I'm not 100% sure on the battery level or the temperature probe sensing circuits, but the LCD segments I'm confident with.

[attachimg=1]

   LCD Segments
   x      x      x      COM3   COM2   COM1   COM0   x      x      x
   SEG0   SEG1   SEG5   SEG6   SEG10   SEG11   SEG12   SEG13   SEG14   SEG15
   
   PA3   temp_sense_enable?   Set high to power the NTC?
   PA5   temp_sense?         Temp read ADC on this pin
   PH0   button?         
   PH1   batt level?         Sense battery level?

   PC14 RCC   Ceramic Clock
   PC15 RCC   Ceramic Clock
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 1917
  • Country: gb
Re: Repurpose a Single Use Libero CB temperature logger
« Reply #8 on: October 02, 2022, 08:55:58 am »
Manufacturer datasheet for this temperature logger is here.
Product line web page is here.

Do you have an example of the PDF produced by this logger?
I'm just interested to see how the PDF is created by this mcu.
« Last Edit: October 02, 2022, 09:08:57 am by voltsandjolts »
 

Offline monthlybasil

  • Contributor
  • Posts: 7
  • Country: au
Re: Repurpose a Single Use Libero CB temperature logger
« Reply #9 on: October 02, 2022, 11:45:25 am »
So I am able to short the boot pin and I think I can upload new firmware to it.

next challenge is how to cycle through the multiplexed lcd elements to identify the lcd pinouts.

I have thought about driving them as GPIO pins, but I need to apply ac to them. So probably the best bet is to write something in STM32CubeIDE but I dont know how to initialise the LCD.

this video was helpful with the methodology to determine the pinouts

eating this elephant one bite at a time.

 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 1917
  • Country: gb
Re: Repurpose a Single Use Libero CB temperature logger
« Reply #10 on: October 02, 2022, 12:47:35 pm »
Thanks for the info.

I can upload new firmware to it.

What PC software are you using, STM32 DfuSe?
 

Offline monthlybasil

  • Contributor
  • Posts: 7
  • Country: au
Re: Repurpose a Single Use Libero CB temperature logger
« Reply #11 on: October 05, 2022, 11:14:16 am »
So I've been researching (https://st-onlinetraining.s3.amazonaws.com/STM32L4_Peripheral_Liquid_Crystal_Display_interface_(LCD)/index.html) and messing around, and I cant get anything to display on the LCD. would the code below produce anything, assuming the other voltages and clk settings are suitable?

Code: [Select]
/* USER CODE BEGIN WHILE */
  while (1)
  {
HAL_LCD_Clear(&hlcd);
HAL_LCD_Write(&hlcd, LCD_RAM_REGISTER0, 0x0000, 32);
HAL_LCD_UpdateDisplayRequest(&hlcd); HAL_Delay(500);
HAL_LCD_Clear(&hlcd);
HAL_LCD_Write(&hlcd, LCD_RAM_REGISTER1, 0x0000, 32);
HAL_LCD_UpdateDisplayRequest(&hlcd); HAL_Delay(500);
HAL_LCD_Clear(&hlcd);
HAL_LCD_Write(&hlcd, LCD_RAM_REGISTER2, 0x0000, 32);
HAL_LCD_UpdateDisplayRequest(&hlcd); HAL_Delay(500);
HAL_LCD_Clear(&hlcd);
HAL_LCD_Write(&hlcd, LCD_RAM_REGISTER3, 0x0000, 32);
HAL_LCD_UpdateDisplayRequest(&hlcd); HAL_Delay(500);
HAL_LCD_Clear(&hlcd);
HAL_LCD_Write(&hlcd, LCD_RAM_REGISTER4, 0x0000, 32);
HAL_LCD_UpdateDisplayRequest(&hlcd); HAL_Delay(500);
HAL_LCD_Clear(&hlcd);
HAL_LCD_Write(&hlcd, LCD_RAM_REGISTER5, 0x0000, 32);
HAL_LCD_UpdateDisplayRequest(&hlcd); HAL_Delay(500);
HAL_LCD_Clear(&hlcd);
HAL_LCD_Write(&hlcd, LCD_RAM_REGISTER6, 0x0000, 32);
HAL_LCD_UpdateDisplayRequest(&hlcd); HAL_Delay(500);
HAL_LCD_Clear(&hlcd);
HAL_LCD_Write(&hlcd, LCD_RAM_REGISTER7, 0x0000, 32);
HAL_LCD_UpdateDisplayRequest(&hlcd); HAL_Delay(500);

    /* USER CODE END WHILE */

 

Offline monthlybasil

  • Contributor
  • Posts: 7
  • Country: au
Re: Repurpose a Single Use Libero CB temperature logger
« Reply #12 on: October 07, 2022, 07:54:16 am »
So LCD is working

Needed to set the LCD Contrast Control to 2.68V.

The following illuminates all the segments

Code: [Select]
  while (1)
  {
  uint16_t screendata1 = 0b1111110001100011;
  uint16_t screendata2 = 0b1111110001100011;
  uint16_t screendata3 = 0b1111110001100011;
  uint16_t screendata4 = 0b1111110001000011;

      HAL_LCD_Write(&hlcd, LCD_RAM_REGISTER0, 0xFC63, screendata1);
      HAL_LCD_Write(&hlcd, LCD_RAM_REGISTER2, 0xFC63, screendata2);
      HAL_LCD_Write(&hlcd, LCD_RAM_REGISTER4, 0xFC63, screendata3);
      HAL_LCD_Write(&hlcd, LCD_RAM_REGISTER6, 0xFC43, screendata4);
      HAL_LCD_UpdateDisplayRequest(&hlcd);
      HAL_Delay(1000);
      HAL_LCD_Clear(&hlcd);
      HAL_Delay(1000);
     
    /* USER CODE END WHILE */

And the segments are mapped out as:

Code: [Select]
RAM REG 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 LowBatt 4b 4a 3b 3a 2b 2a 1b 1a RUN
2 Profile 4g 4f 3g 3f 2g 2f 1g 1f CROSS
4 degC 4c 4e 3c 3e 2c 2e 1c 1e TICK
6 degF % 4d dp3 3d dp2 2d 1d DIAG

now to mess with ADC to get a temp readout over serial.
« Last Edit: October 07, 2022, 11:20:04 pm by monthlybasil »
 

Offline monthlybasil

  • Contributor
  • Posts: 7
  • Country: au
Re: Repurpose a Single Use Libero CB temperature logger
« Reply #13 on: October 10, 2022, 11:42:00 am »
Can anyone help me with changing the LCD Segment Pins so they are in order, or manipulate the order of them so I dont have two 3 bit gaps in the pin table? I have not had much luck with googling a solution.
 

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 3628
  • Country: es
Re: Repurpose a Single Use Libero CB temperature logger
« Reply #14 on: October 12, 2022, 02:18:17 am »
I'd use a combination of indexing tables and functions, using different functions for symbols (lowbatt, etc), which only need to modify one bit of a single register, and the alphanuneric segments, where all memory registers need to be modified to construct the final character.
That way you step to high level functions, making the access much easier.

This is enough as an initial test, untested, written using the phone  :P

Code: [Select]
#include <stdbool.h>
#include <stdint.h>

#define icon_count 9
#define ON true
#define OFF false

typedef enum {
    icon_lowbatt = 0,
    icon_run,
    icon_profile,
    icon_cross,
    icon_degC,
    icon_tick,
    icon_degF,
    icon_percent,
    icon_diag,
} icon_name_t;

typedef struct{
    const uint8_t reg;
    const uint8_t mask;
} icon_data_t;

icon_data_t icon_data[icon_count] = {
    [icon_lowbatt] = { LCD_RAM_REGISTER0, 15 },
    [icon_run]     = { LCD_RAM_REGISTER0, 0  },
    [icon_profile] = { LCD_RAM_REGISTER2, 15 },
    [icon_cross]   = { LCD_RAM_REGISTER2, 0  },
    [icon_degC]    = { LCD_RAM_REGISTER4, 15 },
    [icon_tick]    = { LCD_RAM_REGISTER4, 0  },
    [icon_degF]    = { LCD_RAM_REGISTER6, 15 },
    [icon_percent] = { LCD_RAM_REGISTER6, 14 },
    [icon_diag]    = { LCD_RAM_REGISTER6, 0  },
};


void set_icon(icon_name_t i, bool enable){
    uint16_t mask = 1 << icon_data[i].mask;
    HAL_LCD_Write(&hlcd, icon_data[i].reg, mask, ( enable ? mask : 0 ) );
    HAL_LCD_UpdateDisplayRequest(&hlcd);
}

void main(void){
    while(1){
        set_icon(icon_run, ON);
        HAL_Delay(1000);
        set_icon(icon_run, OFF);
        HAL_Delay(1000);
    }
}
« Last Edit: October 13, 2022, 07:30:49 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: monthlybasil

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 3628
  • Country: es
Re: Repurpose a Single Use Libero CB temperature logger
« Reply #15 on: October 12, 2022, 03:59:36 am »
Digits test. Probably could be simplified, but it lets you see the mechanics very easily.
Code: [Select]
#include <stdbool.h>
#include <stdint.h>

#define char_count 4
#define seg_count 8

#define A   1
#define B   2
#define C   4
#define D   8
#define E   16
#define F   32
#define G   64

const uint8_t digits[] = {
    (A+B+C+D+E+F),         //0
    (B+C),                 //1
    (A+B+G+E+D),           //2
    (A+B+C+D+G),           //3
    (F+G+B+C),             //4
    (A+F+G+C+D),           //5
    (A+F+E+D+C+G),         //6
    (A+B+C),               //7
    (A+B+C+D+E+F+G),       //8
    (D+C+B+A+F+G),         //9
};

typedef enum {
    seg_a = 0,
    seg_b,
    seg_c,
    seg_d,
    seg_e,
    seg_f,
    seg_g,
    seg_dp,
} seg_name_t;

typedef enum {
    char_1 = 0,
    char_2,
    char_3,
    char_4,
} char_name_t;

typedef struct{
    const uint8_t reg;
    const uint8_t mask;
} seg_data_t;

seg_data_t seg_data[char_count][seg_count] = {
    [char_1] = {
         [seg_a]   = { LCD_RAM_REGISTER0, 1  },
         [seg_b]   = { LCD_RAM_REGISTER0, 5  },
         [seg_c]   = { LCD_RAM_REGISTER4, 5  },
         [seg_d]   = { LCD_RAM_REGISTER6, 1  },
         [seg_e]   = { LCD_RAM_REGISTER4, 1  },
         [seg_f]   = { LCD_RAM_REGISTER2, 1  },
         [seg_g]   = { LCD_RAM_REGISTER2, 5  },
    },
    [char_2] = {
         [seg_a]   = { LCD_RAM_REGISTER0, 6  },
         [seg_b]   = { LCD_RAM_REGISTER0, 10 },
         [seg_c]   = { LCD_RAM_REGISTER4, 10 },
         [seg_d]   = { LCD_RAM_REGISTER6, 6  },
         [seg_e]   = { LCD_RAM_REGISTER4, 6  },
         [seg_f]   = { LCD_RAM_REGISTER2, 6  },
         [seg_g]   = { LCD_RAM_REGISTER2, 10 },
         [seg_dp]  = { LCD_RAM_REGISTER6, 10 },
    },
    [char_3] = {
         [seg_a]   = { LCD_RAM_REGISTER0, 11 },
         [seg_b]   = { LCD_RAM_REGISTER0, 12 },
         [seg_c]   = { LCD_RAM_REGISTER4, 12 },
         [seg_d]   = { LCD_RAM_REGISTER6, 11 },
         [seg_e]   = { LCD_RAM_REGISTER4, 11 },
         [seg_f]   = { LCD_RAM_REGISTER2, 11 },
         [seg_g]   = { LCD_RAM_REGISTER2, 12 },
         [seg_dp]  = { LCD_RAM_REGISTER6, 12 },
    },
    [char_4] = {
         [seg_a]   = { LCD_RAM_REGISTER0, 13 },
         [seg_b]   = { LCD_RAM_REGISTER0, 14 },
         [seg_c]   = { LCD_RAM_REGISTER4, 14 },
         [seg_d]   = { LCD_RAM_REGISTER6, 13 },
         [seg_e]   = { LCD_RAM_REGISTER4, 13 },
         [seg_f]   = { LCD_RAM_REGISTER2, 13 },
         [seg_g]   = { LCD_RAM_REGISTER2, 14 },
    },
};

void clear_char(char_name_t c){
    uint16_t mask;

    for(uint8_t i=0; i<seg_count; i++){
        mask = 1 << seg_data[c][i].mask;
        HAL_LCD_Write(&hlcd, seg_data[c][i].reg, mask, 0 );
    }
    HAL_LCD_UpdateDisplayRequest(&hlcd);
}

// Dp not implemented
void write_char(char_name_t c, uint8_t number, bool dp){
    uint16_t mask;

    if (number>9)
        number=8;
       
    for(uint8_t i=0; i<seg_count; i++){
        mask = 1 << seg_data[c][i].mask;
        HAL_LCD_Write(&hlcd, seg_data[c][i].reg, mask,
        ( ((1<<i) & digits[number]) ? mask : 0 ) );
    }
    HAL_LCD_UpdateDisplayRequest(&hlcd);
}

void main(void){
    uint8_t a=0, b=0, c=0, d=0;

    while(1){
        write_char(char_1, a, false);
        write_char(char_2, b, false);
        write_char(char_3, c, false);
        write_char(char_4, d, false);
 
        if(++a>9){
            a=0;
            if(++b>9){
                b=0;
                if(++c>9){
                    c=0;
                    if(++d>9)
                        d=0;
                }
            }
        }
        HAL_Delay(1000);
    }
}
« Last Edit: October 13, 2022, 07:36:07 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: monthlybasil


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 



Advertise on the EEVblog Forum