cancel
Showing results for 
Search instead for 
Did you mean: 

Programming manual document may need list of requirements

RhSilicon
Lead

A novice HAL programmer responded with this image:

I did not find any extended information on the HAL_I2C_Master_Transmit function.
There are a lot of incorrect codes on the Internet with this function, there are even videos on YouTube with the incorrect use of HAL_I2C_Master_Transmit.

PM_req.png

There may be a missing list of requirements for the programmer to be able to interpret the programming documents, not all of these programmers are engineers.

PM_REQ2.png

9 REPLIES 9
MMust.5
Senior II

Absolutely interesting.
Here is my topic.
https://community.st.com/t5/stm32-mcu-products/i-don-t-understand-how-to-use-the-hal-i2c-master-transmit/td-p/582824
Can I then ask for what purpose did you give me links to the Reference Manual if the Reference Manual does not have an answer to my question?
Ah, I get it, you thought I already knew the answer to my question, because only those who know the answer to this question can read the Reference Manual?

Pavel A.
Evangelist III

?? What is not enough, pointer to data buffer? How it is not enough? And why the ST "HAL" library documentation is mixed with PM0214?

PM0214 is the Programming Manual for STM32 Cortex-M4. It is mostly a copy of generic ARM document which they pass to the implementers, specially to make documentation for their CM4 based products. Have more questions? Go to arm.com ... or ask here.

 As for the requirements for the programmers, there is one, very simple: do or die ))

The matter is very simple.
I asked a question about I2C.
I received many links to this question from the creator of this topic.
Those links didn't answer my question, and the person kept giving me links to various sites and the Reference Manual.
I don't mind and even put likes.
He justified his next link by the fact that in the last link there was no answer to my question.
He ended up giving me a guide to learning the C language.
It's good that I stopped this process of producing useless links.

Wikipedia link generator.
For a better understanding, follow the link I gave above.

>What is not enough, pointer to data buffer?
Follow the link for the topic.
To transfer to the register, you need to transfer 2 elements of the array.

The Reference Manual is (in my opinion) the best documentation there is on how to use the peripherals that ST designed and built into their microcontrollers. (This is the primary reference but you sometimes also have to read the Programming Manual which describes the processor core and core peripherals designed by ARM).

These manuals are complicated for the simple reason that the microcontrollers are amazingly complicated - hence amazingly capable - devices.

In my opinion, HAL is not adequately documented. The documentation I have seen seems largely to be "doxygen" - namely what can be gleaned by looking at the appropriate header files, but formatted nicely. It tells you what the calls are, but not how (for example in what order) to use them.

For examples of how to use the HAL libraries, you have to look at the Stm32Cube firmware. But that does not give me an understanding of what's going on and why. For that, I find I have to look through the source-code of the HAL libraries, seeing what gets written and in what order. Where I'm having difficulty understanding the Reference Manual, this can help. But mostly I just look at the Reference Manual on its own; I only refer to HAL where my experiments are going nowhere.

But even that's not enough.

When you're dealing with (for example) I2C, this will tell you how to achieve a specific set of things happening on the I2C bus. But you have to look at the data-sheet of the external device (be it memory, I/O expander, accelerometer or whatever) to work out what things you need to tell the external device to get what you want to happen.

TDK
Guru

If someone doesn't know what "a pointer to data" is, when the type is "uint8_t *", that's not a problem the reference manual or programming manual should be solving. That's programming 101. It's not the RMs job to teach it. The premise of this thread is silly.

Googling "what is a pointer to data in C++" will bring a wealth of information.

If you feel a post has answered your question, please click "Accept as Solution".

TDK, you've answered my question in the topic referenced by the author of this topic.
The essence of the question was not what is a pointer.
Is this some kind of joke?
The essence of the question was in particular the use of HAL_I2C_Master_Transmit.
It was necessary to send 2 array elements, not 1 array element.
Agree, not all functions work this way.

MMust.5
Senior II

You know, if you think so.
Then next time you don’t have to go into my topic and answer my stupid questions.
He himself answered the question and writes now that I asked about the pointer.
What nonsense.

Ok, if you think the point of the question was what is a pointer, then I'll deactivate the mark on your best answer in my thread.
You didn't say what a pointer is.
Now everything is fair.

 

My comment here wasn't addressed to you. My point in this thread was that it's unreasonable to expect ST to explain what a pointer is in the HAL documentation, which is how I interpreted the opening post.

> The essence of the question was in particular the use of HAL_I2C_Master_Transmit.

I agree with you here, but this is a different thread.

You're fine asking questions, that's what the forum is here for. Don't worry about it, and keep in mind things typically aren't meant personally. If you don't like a thread, or someone rubs you the wrong way, the best course of action might be to just ignore them and/or their replies. It's the internet, not everyone will get along, and not every battle needs to be fought. Cheers.

If you feel a post has answered your question, please click "Accept as Solution".

> Ok, if you think the point of the question was what is a pointer, then I'll deactivate the mark on your best answer in my thread.

I didn't think that, but you do your thing. Hope you have a nice day.

If you feel a post has answered your question, please click "Accept as Solution".