cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a demo that generates QRCode

JJIAN.21
Associate II

The chip is:STM32F429

When I was using the downloaded QRcode program, I found that the program crashed. The use method is as follows:0693W000007YzIvQAK.png

17 REPLIES 17

Hello @JJIAN.2​ ,

This is because the string "st.com" is smaller than the string "support.touchgfx.com" so the minimum size to display the data differs.

To make the small QRCode bigger, you need to change the version of the QRCode.

By specifying the version, you can generate a QR code larger than the optimal version (minimum size).

Here is the code you need to change :

bool ok = qrcodegen_encodeText("st.com", tempBuffer, qrcode,
			qrcodegen_Ecc_HIGH, 3/*qrcodegen_VERSION_MIN*/, qrcodegen_VERSION_MAX, qrcodegen_Mask_AUTO, true);

The minimum version value is 1, by setting it to 3 you can match the size of the other QRCode. The size of the QRCOde will always depend on the actual data you want to change into a QRCode. Just tweak the version value when necessary.

/Alexandre

Hi Alexandre

Got it ,thank you ,i'll try.

Agran.1
Associate II

Hello,

I wanted to put your example on the STM32H7B3I-DK.

"On a board you need to open your Application Template .touchgfx project in Designer. Click on Edit-> Import GUI -> Browse -> Select the .touchgfx file enclosed."

but it doesn't work in Run simulator and in Run Target. (picture attached)

Thanks in advanced to all your replies

Hi

Agran.1

Maybe there's something wrong with your steps,I've done a UI example,You can try this one first。The TouchGFX version is :TouchGFX 4.16.0 Designer

Thank you,

I also use the TouchGFX 4.16.0 Designer. but it doesn't work on the STM32H7B3I-DK and I don't understand why.

Hello Alexandre RENOUX (ST Employee),

Do you know why this doesn't work not on the STM32H7B3I-DK even in Run simulator of TouchGFX 4.16.0 Designer

Best regards,

Interesting, I was able to replicate the issue as well with the STM32H7B3dk. But it works fine on my STM32F746dk. I have not looked at the code, I thought it may come from where the QR code are stored or accessed but even the simulator is hit so it must come from the GUI in itself.

/Romain

Hello @Alexandre RENOUX​ ,

When I try to implement QR code for 16bit resolution, it's working fine. But, when I try to implement the same with 24bit Resolution, QR code is appearing as glitch. Can you please help me fix the issue. I am attaching the snip of simulation.0693W00000Dlwg1QAB.png

Hello Revanth,

Indeed when switching to 24bpp the QR code is not working. It's because in the draw() function, we consider a 16bpp 2framebuffer to set black or white for each pixel. In case of 24bpp, the draw function needs to be modified to match this color format.

You will find attached the 24bpp version of the QR Code example (TouchGFX 4.17).

/Alexandre