-
Notifications
You must be signed in to change notification settings - Fork 0
/
api-v1-0.html
383 lines (305 loc) · 18.9 KB
/
api-v1-0.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
<!doctype html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-159666078-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-159666078-1');
</script>
<!-- Yandex.Metrika counter -->
<script type="text/javascript" >
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.com/metrika/tag.js", "ym");
ym(59071672, "init", {
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true
});
</script>
<noscript><div><img src="https://mc.yandex.com/watch/59071672" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
<title>RemoteMCU - API reference version 1.0</title>
<meta name="description" content="Provides a variety of REMCU feature and utility APIs that are compatible with a wide range of platform versions" />
<meta name="robots" content="max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
<link rel="canonical" href="news/api-v1-0.html" />
<script type="application/ld+json">{"@context" : "https://schema.org","@type" : "Organization","logo": "https:\/\/remotemcu.com\/images\/logo\/logo_preview.png","name" : "RemoteMCU","url" : "https:\/\/remotemcu.com\/news","sameAs" : ["https:\/\/www.facebook.com\/remotemcu\/", "https:\/\/twitter.com\/@RemoteMcu", "https:\/\/www.youtube.com\/channel\/UCyIDHcMnHFFRS-SznKUZ9ug", "https:\/\/www.linkedin.com\/company\/remotemcu"]}</script>
<meta property="og:url" content="https://remotemcu.com/api-v1-0" />
<meta property="og:site_name" content="RemoteMCU" />
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="article" />
<meta property="article:author" content="https://www.facebook.com/remotemcu/" />
<meta property="article:publisher" content="https://www.facebook.com/remotemcu/" />
<meta property="article:section" content="API reference" />
<meta property="article:tag" content="remcu" />
<meta property="article:tag" content="api" />
<meta property="article:tag" content="functions" />
<meta property="article:tag" content="methods" />
<meta property="og:title" content="API reference | REMCU Lib" />
<meta property="og:description" content="Provides a variety of REMCU feature and utility APIs that are compatible with a wide range of platform versions" />
<meta property="og:image" content="https://raw.githubusercontent.com/remculib/site/master/benifits/shared_library.png" />
<meta property="og:image:secure_url" content="https://raw.githubusercontent.com/remculib/site/master/benifits/shared_library.png" />
<meta property="fb:pages" content="100628564742383" />
<meta name="twitter:domain" content="remotemcu.com"/>
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@RemoteMcu" />
<meta name="twitter:creator" content="@RemoteMcu" />
<meta name="twitter:title" content="API reference | REMCU Lib" />
<meta name="twitter:description" content="Provides a variety of REMCU feature and utility APIs that are compatible with a wide range of platform versions" />
<meta name="twitter:image:src" content="https://raw.githubusercontent.com/remculib/site/master/benifits/shared_library.png" />
<link rel="icon" type="image/png" href="favicon.png" />
<link rel="apple-touch-icon" href="apple-touch-favicon.png"/>
<!-- Bootstrap core CSS -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link href="css/style.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="https://getbootstrap.com/docs/4.3/examples/product/product.css" rel="stylesheet">
<link href="css/carousel.css" rel="stylesheet">
<!-- Include EnlighterJS Styles -->
<link rel="stylesheet" type="text/css" href="css/EnlighterJS.min.css" />
<!-- Include MooTools Framework -->
<script type="text/javascript" src="js/MooTools.min.js"></script>
<!-- Include EnlighterJS -->
<script type="text/javascript" src="js/EnlighterJS.min.js" ></script>
<meta name="EnlighterJS" content="Advanced javascript based syntax highlighting" data-indent="4" data-selector-block="pre" data-selector-inline="code" data-language="javascript" />
<script type="text/javascript">
//fix conflict carousel and mootools
window.addEvent('domready', function(){
if (typeof jQuery != 'undefined' && typeof MooTools != 'undefined' )
{
Element.implement({
slide: function(how, mode){
return this;
}
});
}
});
</script>
<style>
/* fix conflict bootstrap dropdown item and mootools */
.nav-item {
display:block !important;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExample08" aria-controls="navbarsExample08" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a href="index.html" id="mobilelogo"><img src="images/logo/logo-remcu-mobile.png" srcset="images/logo/logo-remcu-mobile.png 1x, images/logo/logo-remcu-2x-mobile.png 2x" alt="REMCU lib Logo" retina_logo_url="/images/logo/logo-remcu-2x-mobile.png" class="fusion-standard-logo"></a>
<div class="collapse navbar-collapse justify-content-md-center" id="navbarsExample08">
<ul class="navbar-nav">
<li class="nav-item">
<a id="logoblock" href="index.html"><img src="images/logo/logo-remcu.png" srcset="images/logo/logo-remcu.png 1x, images/logo/logo-remcu-2x.png 2x" alt="REMCU lib Logo" retina_logo_url="/images/logo/logo-remcu-2x.png" class="fusion-standard-logo"></a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.html">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="benefits.html">Benefits</a>
</li>
<li class="nav-item">
<a class="nav-link" href="tutorials.html">Tutorials</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/remotemcu/remcu_examples">Examples</a>
</li>
<li class="nav-item">
<a class="nav-link" href="docs.html">Docs</a>
</li>
<li class="nav-item download-button-item">
<a class="btn btn-lg btn-primary" href="https://github.com/remotemcu/">GitHub</a>
</li>
</ul>
</div>
</nav>
<nav class="displaynone navbar-fixed navbar-expand-lg navbar-dark bg-dark">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExample08" aria-controls="navbarsExample08" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a href="index.html" id="mobilelogo" style="float:right; margin-top: 5px;"><img id="logo" src="images/logo/logo-remcu-mobile.png" srcset="images/logo/logo-remcu-mobile.png 1x, images/logo/logo-remcu-2x-mobile.png 2x" alt="REMCU lib Logo" retina_logo_url="/images/logo/logo-remcu-2x-mobile.png" class="fusion-standard-logo"></a>
<div class="collapse navbar-collapse justify-content-md-center" id="navbarsExample08">
<ul class="navbar-nav">
<li class="nav-item">
<a id="logoblock" href="index.html"><img id="logo" src="images/logo/logo-remcu.png" srcset="images/logo/logo-remcu.png 1x, images/logo/logo-remcu-2x.png 2x" alt="REMCU lib Logo" retina_logo_url="/images/logo/logo-remcu-2x.png" class="fusion-standard-logo"></a>
</li>
<li class="nav-item">
<a class="nav-link" href="index.html">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="benefits.html">Benefits</a>
</li>
<li class="nav-item">
<a class="nav-link" href="tutorials.html">Tutorials</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/remotemcu/remcu_examples">Examples</a>
</li>
<li class="nav-item">
<a class="nav-link" href="docs.html">Docs</a>
</li>
<li class="nav-item download-button-item">
<a class="btn btn-lg btn-primary" href="https://github.com/remotemcu/">GitHub</a>
</li>
</ul>
</div>
</nav>
<!-- Carousel start -->
<!-- Carousel end -->
<!-- Main content block start -->
<section id="primary" class="content-area bg-light ">
<main id="main">
<!--
<header class="page-header">
<h1 class="page-title text-center">
API reference version 1.0
</h1>
</header>
-->
<article class="article2 pt-3 px-3 pt-md-5 px-md-5 mx-auto overflow-hidden my-3 p-3">
<header class="entry-header text-center">
<h2 class="entry-title mb-3">API reference version 1.0</h2>
</header><!-- .entry-header -->
<div class="entry-content">
<h2>Functions:</h2>
<h3>remcu_connect2OpenOCD</h3>
<p><code>bool remcu_connect2OpenOCD(const char* host, const uint16_t port, const int timeout_sec);</code></p>
<p>The function is used to create a connection to the OpenOCD server destination.<br />
<em>param</em>:<br />
<strong>host</strong> - ip address of OpenOCD server "XXX.XXX.XXX.XXX". If the server runs on the host machine, the argument should be "localhost" or "127.0.0.1" value.<br />
<strong>port</strong> - port of OpenOCD server. Default is 6666<br />
<strong>timeout_sec</strong> - This parameter specifies the length of time, in seconds,
to wait for a response when establishing communications. It can not be negative!<br />
<em>return</em>: If no error occurs, function returns <strong>true</strong></p>
<h3>remcu_connect2GDB</h3>
<p><code>bool remcu_connect2GDB(const char* host, const uint16_t port, const int timeout_sec);</code><br />
The function is used to create a connection to the GDB server destination<br />
<em>param</em>:<br />
<strong>host</strong> - ip address of GDB server "XXX.XXX.XXX.XXX". If the server runs on the host machine, the argument should be "localhost" or "127.0.0.1" value.<br />
<strong>port</strong> - port of GDB server. Default is 3333. For instance, st-link GDB server and J-link GDB server print the port in log messages. </p>
<details><summary> Jlink windows. Where the port is written <b> (click here)</b></summary><img src="https://raw.githubusercontent.com/remotemcu/remcu_examples/master/wiki/img/jlink.png"><img src="https://raw.githubusercontent.com/remotemcu/remcu_examples/master/wiki/img/jlink2.png"></details>
<details><summary> ST link GDB windows. Where the port is written<b> (click here)</b></summary><img src="https://raw.githubusercontent.com/remotemcu/remcu_examples/master/wiki/img/run-stling-gdb.png"></details>
<p>You can get it from there.<br />
<strong>timeout_sec</strong> - This parameter specifies the length of time, in seconds,
to wait for a response when establishing communications. It can not be negative!<br />
<em>return</em>: If no error occurs, function returns <strong>true</strong></p>
<h3>remcu_disconnect</h3>
<p><code>bool remcu_disconnect();</code><br />
Closes the connection to the debug server(OpenOCD or GDB).<br />
<em>return</em> <strong>true</strong> only if an existing connection was successfully closed.</p>
<h3>remcu_isConnected</h3>
<p><code>bool remcu_isConnected();</code><br />
The function returns true if an attempt to connect is successful.</p>
<h3>remcu_getVersion</h3>
<p><code>const char * remcu_getVersion();</code><br />
The function returns verson of REMCU lib. <strong><em>Don't free the pointer after use!</em></strong></p>
<h3>remcu_resetRemoteUnit</h3>
<p><code>bool remcu_resetRemoteUnit(const enum ResetType type);</code><br />
The function performs a reset of remote target(MCU or SoC)<br />
<em>params</em> <strong>type</strong>: the parameter specifies what should happen after the reset</p>
<blockquote>
<p><strong>RUN (enum value 0) Let the target run<br />
</strong>HALT (enum value 1) Immediately halt the target</p>
</blockquote>
<h3>remcu_setVerboseLevel</h3>
<p><code>void remcu_setVerboseLevel(const enum LevelDebug level);</code><br />
The function sets the verbose level. There are several levels of verboseness one can choose from.<br />
<em>params</em> <strong>level</strong></p>
<blockquote>
<p>level <strong>ERROR (enum value 0) is almost silent, producing only necessary messages<br />
level </strong>WARNING (enum value 1) is good for most purposes, where as.<br />
level <strong>INFO (enum value 2) is good when developing a new pipeline.<br />
level </strong>DEBUG (enum value 3) is good for debugging, especially when getting un-expected results.</p>
</blockquote>
<h3>remcu_getErrorCount</h3>
<p><code>size_t remcu_getErrorCount();</code><br />
The fucntion returns the qty of errors that occurred during the last operations after start or call remcu_clearErrorCount.</p>
<h3>remcu_clearErrorCount</h3>
<p><code>void remcu_clearErrorCount();</code><br />
The function clear the counter of errors in the function above.</p>
<h3>remcu_debuggerTest</h3>
<p><code>const char* remcu_debuggerTest();</code><br />
Some of debug adapters can have hardware problems. The function enables to detect such adapters. The function returns a null pointer if the test is successful. <strong><em>Don't free the pointer after use!</em></strong></p>
<h3>remcu_store2mem</h3>
<p><code>bool remcu_store2mem(const uintptr_t addr, const uint8_t* src, const size_t count);</code><br />
Copies count bytes from the remote MCU memory to by RAM address to the object pointed to by dest.<br />
<em>params</em>:<br />
<strong>addr</strong> - RAM MCU address to copy from. Note that Community and Education versions have restrictions on memory region where you store and load data. To clarify that, see the <a href="download.html">Download</a> page of your chip or the START_AVAILABLE_MEMORY_REGION and EMD_AVAILABLE_MEMORY_REGION constants in device_defines.h(is in remcu_include folder).
<strong>count</strong> - number of bytes to copy. The parameter has to be no more than MAX_MEM_OPERATION_SIZE and less MIN_MEM_OPERATION_SIZE (it is 32 and 6 bytes, respectively, for Community and Education version) . The MAX_MEM_OPERATION_SIZE and MIN_MEM_OPERATION_SIZE constants is defined in remcu.h file.
<strong>dest</strong> - pointer to the memory location to copy to.<br />
<em>Return</em>: If no error occurs, function returns true.</p>
<h3>remcu_loadFrMem</h3>
<p><code>bool remcu_loadFrMem(const uintptr_t addr, const size_t count, uint8_t* dest);</code><br />
The function copies count bytes from the remote MCU memory to by RAM address to the object pointed to by dest.
<em>params</em>:
<strong>addr</strong> - RAM MCU address to copy from. Note that Community and Education versions have restrictions on memory region where you store and load data. To clarify that, see the <a href="download.html">Download</a> page of your chip or the START_AVAILABLE_MEMORY_REGION and EMD_AVAILABLE_MEMORY_REGION constants in device_defines.h(is in remcu_include folder).<br />
<strong>count</strong> - number of bytes to copy. The parameter has to be no more than MAX_MEM_OPERATION_SIZE and less MIN_MEM_OPERATION_SIZE (it is 32 and 6 bytes, respectively, for Community and Education version) . The MAX_MEM_OPERATION_SIZE and MIN_MEM_OPERATION_SIZE constants is defined in remcu.h file.
<strong>dest</strong> - pointer to the memory location to copy to.<br />
<em>return</em>: If no error occurs, function returns true</p>
</div><!-- .entry-content -->
<footer class="entry-footer">
</footer><!-- .entry-footer -->
</article><!-- #post-${ID} -->
</main><!-- #main -->
</section><!-- #primary -->
<!-- Main content block end -->
<footer class="container py-5">
<div class="row">
<div class="col-12 col-md">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="d-block mb-2" role="img" viewBox="0 0 24 24" focusable="false"><title>Product</title><circle cx="12" cy="12" r="10"/><path d="M14.31 8l5.74 9.94M9.69 8h11.48M7.38 12l5.74-9.94M9.69 16L3.95 6.06M14.31 16H2.83m13.79-4l-5.74 9.94"/></svg>
<small class="d-block mb-3 text-muted">Copyright © 2020<br>All Rights Reserved. </small>
</div>
<div class="col-6 col-md">
<h5>RMCU lib</h5>
<ul class="list-unstyled text-small">
<li><a class="text-muted" href="news/api-v1-0.html#">Benefits of library</a></li>
</ul>
</div>
<div class="col-6 col-md">
<h5>Resources</h5>
<ul class="list-unstyled text-small">
<li><a class="dropdown-item" href="https://remotemcu.com/tutorial">Tutorial</a></li>
<li><a class="dropdown-item" href="https://github.com/remotemcu/remcu_examples" target=“_blank” >Examples</a></li>
<li><a class="dropdown-item" href="docs.html">Docs</a></li>
</ul>
</div>
<div class="col-6 col-md" style="margin-right: 20px">
<h5>General contact:</h5>
<ul class="list-unstyled text-small">
<li><a class="text-muted" href="https://ser-mk.github.io/#">ser-mk</a></li>
</ul>
</div>
<div class="col-6 col-md" style="min-width: 250px !important;">
<h5>Follow us</h5>
<a class="social_icon" target="_blank" href="https://www.linkedin.com/company/remotemcu"><img src="images/social_networks_logos/linkedin.png" alt="LinkedIn"></a>
<!--<a class="social_icon" target="_blank" href="https://www.hackster.io/remotemcu"><img src="/images/social_networks_logos/hackster.png" alt="Hackster"></a>
-->
<a class="social_icon" target="_blank" href="https://github.com/remotemcu/"><img src="images/social_networks_logos/github.png" alt="Github"></a>
<a class="social_icon" target="_blank" href="https://www.youtube.com/channel/UCyIDHcMnHFFRS-SznKUZ9ug"><img src="images/social_networks_logos/youtube.png" alt="Youtube"></a>
</div>
</div>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="https://getbootstrap.com/docs/4.3/assets/js/vendor/jquery-slim.min.js"><\/script>')</script><script src="https://getbootstrap.com/docs/4.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o" crossorigin="anonymous"></script>
<script>
$(window).scroll(function(){
var menu = $('.navbar'),
logo = $('#logo'),
scroll = $(window).scrollTop(),
menu_fixed = $('.navbar-fixed')
;
if (scroll >= 400) {
menu_fixed.fadeIn();
}
else {
menu_fixed.fadeOut();
}
});
</script>
</body>
</html>