-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double preprocessor variable for power pin #136
Comments
Thank you, I just fixed it. I left behind STM32 a bit frustrated back then, after I could not figure out how to to use the updated DMA unit of the STM32H7. |
A different problem that I have. STM32 example load image is stuck in a loop, EVE_busy() does not return zero. Would you consider helping via remote meeting with Teams? This is a commercial project, so we can pay for support. |
I am making it a (maybe bad) habbit of not getting paid for support here. That said, which STM32 are we even talking about? Not returning from a load image sounds like an issue with the image though, if you can get up to that point everything else must be working already. |
Ok, I just dusted off my STM32F407 Discovery and copied over the latest library files to the STM32CubeIDE project I was using. But that image is a .jpg and only 3391 bytes in length. Edit: And I put it first because cmd_loadimage is using the top 42kiB of memory to decode .png files. |
I am using a STM32F405RGT6 bare bone no operating system. I have modified your main.c from https://github.com/RudolphRiedel/FT800-FT813/tree/5.x/examples/EVE_Test_STM32_RiTFT50_PlatformIO/src In tft.c the program never returns from: In EVE_commands.c Any Idea what the problem is? I can not use the preprocessor variable USE_HAL_DRIVER since my application does not compile, if it is defined. Settings: |
Ah interesting, the F407 that I am using is practically the same. That seems to be rather low for the SPI clock. I renamed USE_HAL_DRIVER to USE_HAL_DRIVER! and it had no effect at all. But, I am using an EVE3-50G right now, so a BT815. Looks like I might have broken FT81x support somehow. |
Adding a NOP in EVE_cs_clear() also works: But why though? Is this some weird cache issue with the STM32F40x? |
You have used a mix of two STM32 libarys, HAL library and LL library. Atached files only use the HAL library. |
Yes, this is by design, the HAL library is significantly slower. That might also explain why you have issues with the HAL settings, I setup my project to use LL.
Thank you, I'll play with this later. |
"That might also explain why you have issues with the HAL settings, I setup my project to use LL." |
From https://github.com/RudolphRiedel/FT800-FT813/blob/5.x/src/EVE_target.c I generated code for the low leval hal using the STM32CubeMX: You are using spi low level liabary, but init is done using HAL libary. |
Ok, I tried this now: static inline void EVE_cs_set(void) And the impact is measureable, but not at all significant. For example, the three read commands I am using in my touch function now need 300ns to 400ns longer with HAL than with LL, that is not enough to even try and measure it more acurately. Well, it works this way while using LL should be working, but somehow does not work reliably as if a call is optimized away but not always... One might think that the issue could be that the core is so fast that the IO block has no time to actually carry out the level change before the register is written again.
Yes, absolutely. __STATIC_INLINE void LL_GPIO_SetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask) This is just direct register access with a minimal abstraction so that it can work across most STM32 families as long as the correct include is loaded. IOPorts are a bad example in this, these are too simple. void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState) if(PinState != GPIO_PIN_RESET) So also almost direct register access. while (!LL_SPI_IsActiveFlag_TXE(EVE_SPI)) {} This works across a lot of STM32 familes, wherever that bit actually is placed. ST unfortunately broke with this for the STM32H7 for example: Whatever the reason was behind renaming that bit for STM32H7 only...
Sure, here: Not that this is a real project, just something I tinkered with to implement STM32 support in my library. And I am using HAL for the initialization as this part is not time crititcal at all. But for example HAL_SPI_TransmitReceive() is 241 lines long for the STM32F4 and does a lot of things that really are not necessary to do over and over and over again. |
Thank you for the EVE_Test_STM32F407 projekt! I have an STM32F0DISCOVERY that I will try to modyfy and run the EVE_Test_STM32F407 projekt on. If that fails I will buy the same card as you have. |
Well, this is supposed to run on everything with any EVE display module, kind off. :-) I do not have a ME812A, but the configuration is in EVE_config.h. And if it is still not working I would like to see a logic analyzer trace. |
Hello Rudolph, Best regards |
Hi, |
Hi, |
Then I do not understand the issue as the low-level library does practically nothing beyond supplying an API for direct register access. Sure, there is nothing wrong with using HAL library, it only is slower as it executes not necessary code over and over again. |
Hi Rudolph, /Jonas |
Hi Rudoiph! /Jonas |
Damn, I forgot to attach the archive that I prepared over all the fun with the logic analyzer. Here, I edited it from scratch again, might not be 100% the same, but I have no access to the file right now. |
Hi Rudolph, |
Well, "optimized", this is more clean up than optimization, using HAL for SPI transfers remains slow. |
Hi Rudolph, To EVE_target_STM32 and removed commented out code. |
Hi Rudolph! /Jonas |
Hi,
Because the library is mostly for C, not C++ and there are no namespaces in C. And then, when you export it from ESE it becomes: And then there also is this: So the better question might be why there is no ESE exporter for my library and why ESE is not offering export for all of the Bridgtek formats, or also what the "official" C API is. :-) And I started to tinker with an export script but never finished it. |
Good points! |
I just went over my mails and just remembered what I wanted to write earlier.
Why though? |
If comment out the folowing in EVE_target_STM32.h: |
So, then define it in your build environment? :-) Ok, so you rather add an include file with the pin configuration than to add all the parameters to the build environment? |
"Ok, so you rather add an include file with the pin configuration than to add all the parameters to the build environment?" |
That is not my "issue", I suggest using a different macro to trigger including a file from the target headers, like EVE_CUSTOM_PINS_H for example. |
Good idea! |
Why are you using a custom module configuration though? |
We have changed the touch calibration values for EVE_ME812A. |
Ah ok, not a custom module, so EVE_CUSTOM_MODULE_H in EVE_config.h does not actually need to load this. |
My thought was that EVE_config.h should be informed that EVE_ME812A is defined. By including Defines.h via EVE_CUSTOM_MODULE_H. But I might have missed something. |
And you are not wrong, EVE_config.h needs this. |
And EVE_target.h includes EVE_target_STM32. EVE_target_STM32 includes Defines.h via the use of EVE_CUSTOM_PINS_H. |
Hello Rudolph! |
Well, it started out with an issue. :-) |
I am trying to use the libary for an STM32 MCU. After stepping the SPI initialization code, I discovered that there are two preprocessor variables for the power pin.
EVE_PD_PORT_NUM=4U mening GPIOD
EVE_PDN_PORT_NUM=4U mening GPIOD
This appears to be wrong.
The text was updated successfully, but these errors were encountered: