Posts by HaJoCC

    Hi!

    According to the change notes of v7.88j
    "Renesas RA family: Added support for protection unlock via ALeRASE code"
    this feature is expected to work now, but it "does not" - full-featured as I had expected......

    (I tried this code F0000000000000000000000000000000 flashed at 0x1010018 - this protects the code - but J-Flash fails to (re-)connect with this code. The known ALeRASE-Skript works - it disables the protection and erases the flash.)


    With ID Code FFFFFFFFFFFFFFFFFF45534152654C41 entered (which is the ALeRASE-Code in HEX. NOT 414C6552415345FFFFFFFFFFFFFFFFFF) it works directly in J-Flash and J-Flash Lite now: J-Flash triggers ERASE ALL, so read back values are in erased state and that is what is written in the change note: unlock via ALeRASE code (so unlock AND erase...)


    But that does not mean, that "ID Code Verification" works with different IDs. The ALeRASE value deletes all, but all other ID codes used and entered do not unlock the protection yet (intended WITHOUT erasing).

    Is this planned for a future release?


    Best regards,

    HaJo

    Just create a program.jlink file with all commands needed, like this with Python or ...

    Code
    si SWD
    speed 4000
    connect
    loadfile CONFIG_X.hex
    loadfile Filename_XY1.hex
    loadfile OptionByte_X.hex
    rx 500
    go
    exit

    Call jlink.exe -device XYZ -CommandFile program.jlink

    Of course, interface and speed could be set in command line already.

    You have full control inside (reset and/or run or...) and can change the filename(s) to be flashed here.

    I call this commandfile scripted with a fixed name, but I change the content (filename-hex, config or version) every time before start. I also evaluate the output or log to check for errors (no USB, not properly connected, other write fails due to readout protection still set etc.).

    I do not need a single "loadfile" filename in the command line, that would not be enough in my case. I would need 3 filenames (for DataFlash, Flash and OptionByte), but I like the flexibility of these command files.


    Best regards,

    HaJo

    Hi!

    Line ending here is just carriage return, no comments or anything else inside!
    With ..test2 and jlink.exe command line parameters only the first line will be executed properly.

    Since v7.88l JLINK requires CRLF in these files! So, that is the reason for this behaviour.
    I have to correct the line endings (which are generated by script).

    Best regards,

    HaJoCC

    Hi!

    Since v7.88l JLINK.EXE refuses to run my scripts properly (with jlink plus connected):
    Skript1 - last command "connect" not executed:

    device R7FA2E1A9
    si SWD
    speed 4000
    connect


    After further investigation I suppose that only the first line is executed properly, if device, speed and interface is given already as command line parameter before that.

    Skript2:

    erase 0x40100000, 0x40100FFF, reset
    erase 0x40100000, 0x401000FF, reset
    loadfile testfile.hex

    results in:

    As you can see after "Processing script file...", there is something wrong.
    I tested all versions x86_x64 since v7.86f till v7.92d.

    Can anyone confirm that behaviour? Did I miss something in the release notes?

    Perhaps it has something to do with

    7.88l:
    Other changes:

    Commander
    If a C/C++ comment was used in a command that accepts parameters, the comment was accidentally interpreted as parameter. Fixed.


    Best regards,

    HaJo

    Dear SEGGER experts,

    is this dialogue supposed to work with this type of MCU?

    I expected to connect to this MCU again by entering the valid ID Code according to the documentation, but it fails. I also tried the reversed bit order and other mirrored ID codes.

    The JFlash ALeRASE skript works - kill the protection and erase all as intended.

    My intention is to protect the code with an ID code and use this ID Code to connect again and flash a different firmware (or to debug).
    I found a post about RA2L1. There it seems to work like that.

    (J-Flash v7.88e)

    Best regards,
    HaJo

    Found the solution!

    Setting XSIZE_PHYS 320 and YSIZE_PHYS to 480 instead of 240...

    SIM_GUI_SetMag(2,1); to double the x-resolution for the simulation (because 0.5 in y is not possible). X and Y have correct ratio on PC screen in frame.

    Change device.bmp where the GUISimulationDebug.exe resides to 640x480 (not 320x480!). Now the simulation shows the correct aspect ratio (double pixel size is OK).
    It does not work without device.bmp, since the black standard frame does not scale automatically, which was the main problem...

    I can use all my old bitmaps for 320x240 version just with GUI_DrawBitmapMag ((void*)PIC,x,y,1,2); Magnification x2 in y direction.
    I just had to generate new font files with magnification 2 and I have to change some y-coordinates or spacing and I am done.

    I also added a black canvas to the blank device.bmp and added SIM_GUI_SetLCDPos(5,5) to see a border around the final screen area.

    HaJo

    Hi !

    I would like to change the resolution and scaling in y-direction, but it does not work.
    My GUI works fine in 320x240 (on native display hardware and in Win32, aspect ratio 4:3). I changed the hardware display to a high-DPI 320x480 type display, so we have a double y-resolution, but the same aspect ratio. The simulation shows real pixels 320x480 (1:1) - stretching in y, the display itself shows the aspect ratio according to the double density pixels, which is the same as in a 320x240 pixel display.
    Is there an option to scale the Win32 in y direction according to the real look and feel of the display? (same display representation/aspect ratio). Or is there a workaround for that?

    Is it possible to keep the 320x240 setting and scale it or magnify it for the 320x480 view (keep on working on 320x240 but compile for 320x480)? The WIN32 simulation does not know a half pixel width, only double.
    I also get in trouble with fonts. The representation should be 1:2, then. Magnification in y direction also increases the data size. Is it possible to do that on the fly (use the 320x240 font representation with scaling)?

    Best regards,

    HaJo

    Hi !
    I understand that not all features are available in STemWin 5.32 for STM32 for free.

    Unfortunately, the x-y-swapped LIN-Driver for 1bpp is not supported by the compiled library (CM0), but mirror for x an y are. Could this be changed in the next release?
    I have to use GUI_SetOrientation now. This takes 9kB FLASH and 6kB SRAM here. Is there an easy workaround for this?
    ST still provides the "old" V5.32.
    Best regards,
    HaJo

    Hi,
    in certain examples there are only characters included which are used here. Is there an easy way to achieve that automatically?
    It is o.k. to pick some characters one by one in the font converter or even all...
    HOWEVER: now I have a chinese text to be displayed. Due to lack of memory I presently use XBF-files (completely converted font) on a SD Card (SimHei, 5 Megabytes!).
    I would like to extract only characters used in the final text (like 200 characters out of 20.000) to include them in memory directly (font.c).
    Due to the complexity of the font file format in C, the tables (GUI_CHARINFO_EXT) and links inside have to be (re-)constructed. I hope there is a tool available...
    After some testing and investigation I suggest a script that picks the unicodes of the characters used in the text as a list (ordererd by value) and that copies and links these character information together. As a result I would like to have a working font.c file. I am able to copy all things together to a new file, but some Information is missing.
    As an example I try to understand ARIAL in unicode16 converted to c file. The GUI_FontArial25_CharInfo and the used index values are not clear.
    The areas were split into sections and linked to eachother. Now I suppose I have to generate these single properties for all characters which are in one block. The next property must be the data for the next character(s) in the next related block and so on. Can you confirm this?

    I think someone already asked for an explanation of the format (stuff like GUI_CHARINFO_EXT), but got no answer...
    So my questions are:
    Is there a tool for that ? I would pay for this...
    If not, what is the secret of this font file format?
    Otherwise I have to spend some time with autohotkey and trial & error. The font converter creates all required data. So I think I do not need to understand GUI_CHARINFO_EXT, just use the lines needed for each character used in the text file...

    By the way... It is possible to create or convert specific XBF fonts via command line which are not available in the font dialog box (FontCnvSt V5.26) - like Arial Unicode MS and others. Is this some kind of restriction?

    Best regards,
    HaJoCC

    Hi !
    How can I paint text on top of existing dalog windows? "Empty" universal buttons should be filled with text in different languages as an overlay instead of using different Images with included text.
    WM_PAINT (dialog) paints the buttons. But GUI_DispStringAt("OK",140,145) as last line in WM_PAINT creates this text "below" the button which is created as IMAGE_CreateIndirect, "OK Button", ID_IMAGE_OK, 162, 153, 124, 50, 0,IMAGE_CF_AUTOSIZE, 0. The text is always hidden by this button.
    The order does not have influence on what is in the foreground area. It seems like the text will be painted in the background and the window (IMAGE) always covers this area.
    Is there an easy way to achieve this? Perhaps combining text and button and painting the result? Or a certain flag for the window itself?
    It is probably a misunderstanding of how and in which order the texts and images are drawn. I tried to find examples for this case, but I did not find the right one.
    Is there a difference between using GUI_DrawBitmap and GUI_DispStringAt in WM_INIT_DIALOG or WM_PAINT?
    WM_SetCreateFlags(WM_CF_MEMDEV) is set.

    Best regards,
    HaJoCC

    Hi!

    I just tried to compile emwin5.30 unmodified demo from SeggerEval_WIN32_MSVC_MinGW_GUI_V530.zip with CodeBlocks (SimulationTrial.cbp).
    I get this error:
    GUI\Library\GUI.a(GUI_SPY.o):GUI_SPY.c|| undefined reference to `GUI_SPY_X_StartServer'|
    due to line 32 in guidemo_start.c.

    I would like to test the emspy functionality. Is it not available in this demo?
    #define GUI_SUPPORT_SPY 1 according to manual does not help...


    Best regards,
    HaJo

    Hello Adrian,

    is it true that a timer always triggers WM_Paint in a dialog?

    There is nothing to repaint, because nothing has changed. This is intended, right?
    Does the gui always repaint or only when necessary (invalid area)? I wonder if it eats CPU-power by going through the WM_PAINT every time the timer triggers...

    Best regards,
    HaJo

    Hello Adrian,

    is it true that a timer always triggers WM_Paint in a dialog?

    There is nothing to repaint, because nothing has changed. This is intended, right?
    Does the gui always repaint or only when necessary (invalid area)? I wonder if it eats CPU-power by going through the WM_PAINT every time the timer triggers...

    Best regards,
    HaJo

    Hello Adrian !

    I tested the following:

    GuiBuilder, create a window with a bitmap, a text and another bitmap. First bitmap is in background, then text and the second bitmap above the text (partially covered) as expected. Same in simulation, of course.
    Changing the order in _aDialogCreate changes the order on the display as expected.

    If I do not use IMAGE_SetBMP but GUI_DrawBitmap instead, the text (Text_CreateIndirect) will ALWAYS be in front of that picture! What is the reason for that?
    I need that picture (Bitmap) covering text (overlay).

    I think you will recommend a child window containing the other picture drawn with DrawBitmap. That window should be on top of the background with the text. This picture is intended to be used as a button/widget (therefore it will be drawn exactly in the area created with IMAGE_CreateIndirect in the DialogCreate).

    I would like to do that in the area I created already in the main window. But then the text will be on top, not below. I do not understand why the text drawn "before" the picture remains in front. Is there a flag needed to change that behaviour?

    IMAGE_SetBitmap works, but why does GUI_DrawBitmap not have the same result? I expect that this is always painted to the background.

    Best regards,
    HaJo