├── .github └── workflows │ └── br2-t113-build.yml ├── .gitmodules ├── LICENSE ├── README.md └── docs ├── 01-BoardIntroduction.md ├── 02-SupportingResources.md ├── 03-1_FlashSystemSpiFlash.md ├── 03-2_FlashSystemTFCard.md ├── 03-QuickStart.md ├── 04-StudyPath.md ├── 05-1_RunHelloword.md ├── 05-2_RunHellowordDriver.md ├── 06-ConfigHostEnv.md ├── 07-Buildroot-SDK_DevelopmentGuide.md ├── 08-BuildBootloader.md ├── 09-BuildLinuxKernel.md ├── 10-1_BuildrootSupportWifiBluetooth.md ├── 10-BuildRootfs.md └── 11-StartProcessAnalysis.md /.github/workflows/br2-t113-build.yml: -------------------------------------------------------------------------------- 1 | name: Auto Build buildroot_100ask_t113-pro system. 2 | 3 | on: 4 | push: 5 | tags: 6 | - '*' 7 | 8 | jobs: 9 | build-all: 10 | runs-on: ubuntu-18.04 11 | strategy: 12 | matrix: 13 | config: [100ask_t113-pro_sdcard_core_defconfig,100ask_t113-pro_sdcard-lvgl-desktop_defconfig ] 14 | steps: 15 | - uses: actions/checkout@v2 16 | with: 17 | path: buildroot_100ask_t113-pro 18 | 19 | - name: Install buildroot dependencies 20 | run: sudo apt-get install -y which sed make binutils build-essential gcc g++ bash patch gzip bzip2 perl tar cpio unzip rsync file bc wget python ncurses5 bazaar cvs git mercurial rsync scp subversion android-tools-mkbootimg 21 | 22 | - run: cd buildroot_100ask_t113-pro 23 | 24 | - name: Clone Submodules 25 | run: git submodule update --init --recursive && git submodule update --recursive --remote 26 | 27 | - name: Build Buildroot 28 | run: make -C buildroot BR2_EXTERNAL="../br2t113pro ../br2lvgl" O=./output ${{ matrix.config }} 29 | 30 | - name: Build toolchain 31 | run: make -C buildroot BR2_EXTERNAL="../br2t113pro ../br2lvgl" O=./output sdk 32 | 33 | - name: Compress sdcard.img 34 | run: gzip -9 output/images/*sdcard.img 35 | 36 | - run: tar -czvf ${{ matrix.config }}.tar.gz output/images/* 37 | 38 | - name: Store images 39 | uses: actions/upload-artifact@v2 40 | with: 41 | name: ${{ matrix.config }} 42 | path: ${{ matrix.config }}.tar.gz 43 | 44 | - run: ls -la 45 | 46 | - name: Release 47 | uses: softprops/action-gh-release@v1 48 | if: startsWith(github.ref, 'refs/tags/') 49 | with: 50 | files: | 51 | ${{ matrix.config }}.tar.gz 52 | 53 | - run: ls -la 54 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "br2lvgl"] 2 | path = br2lvgl 3 | url = https://e.coding.net/weidongshan/100ask_t113-pro/buildroot-external-lvgl.git 4 | [submodule "buildroot"] 5 | path = buildroot 6 | url = https://e.coding.net/weidongshan/100ask_t113-pro/buildroot-2022.git 7 | [submodule "br2t113pro"] 8 | path = br2t113pro 9 | url = https://e.coding.net/weidongshan/100ask_t113-pro/buildroot-external-t113-pro.git 10 | [submodule "br2qt5"] 11 | path = br2qt5 12 | url = https://e.coding.net/weidongshan/br2-external-tree/buildroot-external-qt5.git 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Buildoot For 100ask-t113-pro board. 2 | 3 | * 运行环境,此套构建系统基于全志T113-S3 芯片,适配了buildroot 2022lts主线版本,兼容了百问网的项目课程以及相关组件,真正做到了低耦合,高可用,使用不同的buildroot external tree规格,讲不同的项目 不同的组件分别管理,来实现更容易上手 也更容易学习理解。 4 | 5 | 1. [开发板硬件介绍](./docs/01-BoardIntroduction.md) 6 | 7 | 2. [开发板支持的资源](./docs/02-SupportingResources.md) 8 | 9 | 3. [开发板快速上手](./docs/03-QuickStart.md) 10 | 11 | 3.1 [烧写更新spinandflash](./docs/03-1_FlashSystemSpiFlash.md) 12 | 13 | 3.2 [烧写更新TF卡](./docs/03-2_FlashSystemTFCard.md) 14 | 15 | 4. [开发板配套资源](./docs/04-StudyPath.md) 16 | 17 | 5. [运行一个helloword](./docs/05-1_RunHelloword.md) 18 | 19 | 6. [运行一个helloword驱动程序](./docs/05-2_RunHellowordDriver.md) 20 | 21 | 7. [配置开发环境](./docs/06-ConfigHostEnv.md) 22 | 23 | 8. [BuIldroot-SDK最小系统开发](./docs/07-Buildroot-SDK_DevelopmentGuide.md) 24 | 25 | 9. [Buildroot单独编译构建uboot](./docs/08-BuildBootloader.md) 26 | 27 | 10. [BuIldroot单独构建kernel](./docs/09-BuildLinuxKernel.md) 28 | 29 | 11. [BuIldroot单独构建Rootfs](./docs/10-BuildRootfs.md) 30 | 31 | 12. [BuIldroot支持WIFI蓝牙组件](./docs/10-BuildRootfs.md) 32 | 33 | 13. [Buildroot打包流程分析](./docs/11-StartProcessAnalysis.md) 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /docs/01-BoardIntroduction.md: -------------------------------------------------------------------------------- 1 | # 100ASK_T113_PRO开发板硬件简述 2 | 3 | * 此开发板的任何问题都可以在我们的论坛交流讨论 https://forums.100ask.net/c/aw/15 4 | 5 | 6 | 7 | ## 硬件简述 8 | 9 | 100ask_t113_pro开发板是百问网针对于D1-H/D1s衍生出来的一个双ARM架构开发板,主要用于学习全志的芯片Linux开发项目开发等用途。 10 | 11 | * 开发板的形态: 核心板 + 不同底板 12 | * 全功能 PRO开发板,将所有的IO引脚 最大化引出,开发板大小保持了 和IMX6ULL PRO 一致的大小。 可以直接固定我们的7寸 RGB显示屏。 13 | * 最小T113 Lite 开发板,是只保留最基本的接口,将所有的IO接口 引出到底板上,用于个人DIY 或者功能验证使用。 14 | 15 | ### T113-S3核心板 16 | 17 | ![T113_S3_Core](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/100ask_t113_pro/T113_S3_Core.png) 18 | 19 | * 主芯片参数简述:T113-S3 是一款先进的应用处理器,专为汽车和工业控制市场而设计。 它集成了双核CortexTM-A7 CPU和单核HiFi4 DSP,提供高效的计算能力。 T113-S3 支持 H.265、H.264、MPEG-1/2/4、JPEG、VC1 等全格式解码。 独立的硬件编码器可以编码为 JPEG 或 MJPEG。 集成多个 ADC/DAC 和 I2S/PCM/DMIC/OWA 音频接口,可提供完美的语音交互解决方案。 T113-S3具有丰富的连接性,方便产品扩展,如USB、SDIO、EMAC、TWI、UART、SPI、PWM、GPADC、IR TX&RX等。 20 | * 芯片架构框图 21 | 22 | ![T113_Bref](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/100ask_t113_pro/T113_Bref.png) 23 | 24 | * 核心板其它配置 25 | * 板载 128MB SPI NANDFLASH x1 26 | * 全针脚引出 27 | 28 | 29 | 30 | ### 全功能Pro开发板 31 | 32 | ![T113-Pro_Function_List](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/100ask_t113_pro/T113-Pro_Function_List.png) 33 | 34 | | 序号1:RESET复位按键,主要用于复位系统使用。 | 序号2:用户按键,可自定义功能。 | 35 | | ------------------------------------------------------------ | ------------------------------------------------------------ | 36 | | **序号3**:**TF卡卡槽,用于读取TF卡并支TF卡启动系统。** | **序号4**:**XR829无线模组配套的ANT天线接口。** | 37 | | **序号5**:**Debug接口,用于串口输出,显示系统信息,调试登录等。** | **序号6**:**OTG接口,主要用于烧写SPI-NAND系统使用,也可用于ADB调试。** | 38 | | **序号7**:**电源供电切换开关,用于切换供电方式是OTG口还是DC电源口。** | **序号8**:**DC接口,用于接入专用电源适配器给开发板独立供电。** | 39 | | **序号9**:**eSIM卡接口,手机卡接口,用于4G模块拨号上网使用。** | **序号10**:**TYPE-A USB2.0接口,用于连接常见USB设备。** | 40 | | **序号11**:**TYPE-A USB2.0接口,用于连接常见USB设备。** | **序号12**:**TYPE-A USB2.0接口,用于连接常见USB设备。** | 41 | | **序号13**:**TV IN/OUT接口,用于连接老式AV电视机输出。** | **序号14**:**多余排针信号引出 有一路I2C信号及4路 ADC信号。** | 42 | | **序号15**:**3.5MM耳机接口,用于播放声音。** | **序号16**:**MIC咪头,专用于用于录音。** | 43 | | **序号17**:**LINE接口,用于播放声音。** | **序号18**:**RGB LCD接口,用于驱动显示RGB屏幕。** | 44 | | **序号19**:**E-INK水墨屏接口,用于驱动类SPI水墨屏。** | **序号20**:**DVP摄像头电压选择。** | 45 | | **序号21**:**DVP摄像头专用接口。** | **序号22**:**DVP摄像头电压选择。** | 46 | | **序号23**:**DVP摄像头电压选择。** | **序号24**:**RJ45网线接口,用于连接有线网络。** | 47 | | **序号25**:**T113主芯片,具体参数可看规格书。** | **序号26**:**网卡与摄像头功能选择排针,根据排针连接方向选择合适的复用方式。** | 48 | | **序号27**:**RTL8201F网卡PHY芯片,用于有线上网。** | **序号28**:**SPI-NAND FLASH,用于存储系统,系统支持SPI NAND启动。** | 49 | | **序号29**:**XR829模组,用于WiFi Bluetooth 无线通信支持。** | **序号30**:**USB HUB芯片,用于扩展多路USB接口。** | 50 | | **序号31**:**USB串口芯片,用于支持TTL转USB信号输出。** | **序号32**:**USB PCI-E接口,专用于4G模组连接使用。** | 51 | 52 | 53 | 54 | ### T113 Lite开发板 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /docs/02-SupportingResources.md: -------------------------------------------------------------------------------- 1 | 2 | ## 软件资源简述 3 | ### BWW提供的SDK 4 | #### Buildoot For Dongshan NezhaSTU D1-H 5 | 6 | **有视频 有文档 有手册** 7 | 8 | * 仓库地址 https://github.com/DongshanPI/buildroot_100ask_t113-pro 9 | 10 | 11 | 12 | #### elinuxCore 最小东山哪吒STU D1 嵌入式Linux系统 13 | 14 | **有视频 有文档 有手册** 15 | 16 | * https://github.com/DongshanPI/eLinuxCore_100ask-t113-pro 17 | -------------------------------------------------------------------------------- /docs/03-1_FlashSystemSpiFlash.md: -------------------------------------------------------------------------------- 1 | # 烧写固件至SPI NAND 2 | 3 | **注意此方式烧录进的文件系统是ubifs文件系统,如果操作 需要网络文件系统挂载或者使用TF卡,不推荐使用。** 4 | 5 | ## 准备工作 6 | 7 | 1. 东山哪吒STU开发板主板 x1 8 | 2. 下载全志线刷工具AllwinnertechPhoeniSuit: https://gitlab.com/dongshanpi/tools/-/raw/main/AllwinnertechPhoeniSuit.zip 9 | 3. TypeC线 X2 10 | 4. 下载SPI NAND最小系统镜像:https://gitlab.com/dongshanpi/tools/-/raw/main/buildroot_linux_nand_uart3.zip 11 | 5. 下载全志USB烧录驱动:https://gitlab.com/dongshanpi/tools/-/raw/main/AllwinnerUSBFlashDeviceDriver.zip 12 | 13 | ## 连接开发板 14 | 15 | * 参考下图所示,将两个TypeC线分别连至 开发板 串口接口 与 OTG烧写接口,另一端 连接至 电脑USB接口,连接成功后,可以将下载好的 烧写工具和 SPI NAND最小系统镜像解压缩 使用。 16 | 17 | ![T113-Pro_FlashSystem](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/100ask_t113_pro/T113-Pro_FlashSystem.png) 18 | 19 | 20 | 21 | * 使用镊子或者杜邦线短接 核心板 SPI NAND FLASH 5-6脚,也就是 MOSI 与SCLK,短接的同时,可以按下 底板上的 RESET 按键,这个时候开发板会进入到FEL烧写模式,进入烧写模式后,我们就可以继续往下安装 专门的烧录驱动。 22 | 23 | ![T113-Pro_FlashSystem_002](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/100ask_t113_pro/T113-Pro_FlashSystem_002.png) 24 | 25 | 26 | ## 安装usb驱动 27 | 28 | 在我们连接好开发板以后,先按住 **FEL** 烧写模式按键,之后按一下 **RESET** 系统复位键,就可以自动进入烧写模式。 29 | 30 | 这时我们可以看到设备管理器 **通用串行总线控制器** 弹出一个 未知设备 ,这个时候我们就需要把我们提前下载好的 **全志USB烧录驱动** 进行修改,然后将解压缩过的 **全志USB烧录驱动** 压缩包,解压缩,可以看到里面有这么几个文件。 31 | 32 | ```bash 33 | InstallUSBDrv.exe 34 | drvinstaller_IA64.exe 35 | drvinstaller_X86.exe 36 | UsbDriver/ 37 | drvinstaller_X64.exe 38 | install.bat 39 | ``` 40 | 41 | 对于wind7系统的同学,只需要以管理员 打开 `install.bat` 脚本,等待安装,在弹出的 是否安装驱动的对话框里面,点击安装即可。 42 | 43 | 对于wind10/wind11系统的同学,需要在设备管理器里面进行手动安装驱动。 44 | 45 | 如下图所示,在第一次插入OTG设备,进入烧写模式设备管理器会弹出一个未知设备。 46 | 47 | ![Windows_FlashDevice_001](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/Windows_FlashDevice_001.png) 48 | 49 | 接下来鼠标右键点击这个未知设备,在弹出的对话框里, 点击浏览我计算机以查找驱动程序软件。 50 | 51 | ![Windows_FlashDevice_001](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/Windows_FlashDevice_002.png) 52 | 53 | 之后在弹出新的对话框里,点击浏览找到我们之前下载好的 usb烧录驱动文件夹内,找到 `UsbDriver/` 这个目录,并进入,之后点击确定即可。 54 | 55 | ![Windows_FlashDevice_001](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/Windows_FlashDevice_007.png) 56 | 57 | 注意进入到 `UsbDriver/` 文件夹,然后点击确定,如下图所示。 58 | 59 | ![Windows_FlashDevice_001](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/Windows_FlashDevice_003.png) 60 | 61 | 此时,我们继续点击 **下一页** 按钮,这时系统就会提示安装一个驱动程序。 62 | 在弹出的对话框里,我们点击 始终安装此驱动程序软件 等待安装完成。 63 | 64 | ![Windows_FlashDevice_001](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/Windows_FlashDevice_004.png) 65 | 66 | 安装完成后,会提示,Windows已成功更新你的驱动程序。 67 | 68 | ![Windows_FlashDevice_001](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/Windows_FlashDevice_005.png) 69 | 70 | 最后我们可以看到,设备管理器 里面的未知设备 变成了一个 `USB Device(VID_1f3a_efe8)`的设备,这时就表明设备驱动已经安装成功。 71 | 72 | ![Windows_FlashDevice_001](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/Windows_FlashDevice_006.png) 73 | 74 | 75 | ## 运行软件烧写 76 | 77 | 将下载下来的全志线刷工具 **AllwinnertechPhoeniSuit** 解压缩,同时将**SPI NAND最小系统镜像**下载下来也进行解压缩。 78 | 79 | 解压后,得到一个 **buildroot_linux_nand_uart3.img** 镜像,是用于烧录到SPI NAND镜像得。另一个是**AllwinnertechPhoeniSuit**文件夹。 80 | 81 | 首先我们进入到 **AllwinnertechPhoeniSuit\AllwinnertechPhoeniSuitRelease20201225** 目录下 找到 **PhoenixSuit.exe** 双击运行。 82 | 83 | 打开软件后 软件主界面如下图所示 84 | 85 | ![PhoenixSuit_001](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/PhoenixSuit_001.png) 86 | 87 | 88 | ​ 接下来 我们需要切换到 **一键刷机**窗口,如下图所示,点击红框标号1,在弹出的新窗口内,我们点击 红框2 **浏览** 找到我们刚才解压过的 SPI NAND 最小系统镜像 **buildroot_linux_nand_uart3.img**,选中镜像后,点击红框3 **全盘擦除升级** ,最后点击红框4 **立即升级**。 89 | 90 | ​ 点击完成后,不需要理会 弹出的信息,这时 我们拿起已经连接好的开发板,先按住 **FEL** 烧写模式按键,之后按一下 **RESET** 系统复位键,就可以自动进入烧写模式并开始烧写。 91 | 92 | ![PhoenixSuit_002](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/PhoenixSuit_002.png) 93 | 94 | 95 | ​ 烧写时会提示烧写进度条,烧写完成后 开发板会自己重启。 96 | 97 | ![PhoenixSuit_003](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/PhoenixSuit_003.png) 98 | 99 | 100 | ## 启动系统 101 | 102 | 一般情况下,烧写成功后 都会自动重启 启动系统,此时我们进入到 串口终端,可以看到它的启动信息,等所有启动信息加载完成,输入 root 用户名即可登录烧写好的系统内。 103 | 104 | ![spinand-flashsystem_001](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/spinand-flashsystem_001.png) 105 | 106 | **系统的登录用户名 root 密码为空** 107 | 108 | **系统的登录用户名 root 密码为空** 109 | 110 | **系统的登录用户名 root 密码为空** 111 | 112 | -------------------------------------------------------------------------------- /docs/03-2_FlashSystemTFCard.md: -------------------------------------------------------------------------------- 1 | # 烧写固件至TF卡 2 | 3 | ## 准备工作 4 | 1. T113开发板主板 x1 5 | 2. Type-C线 X1 6 | 3. TF卡读卡器 x1 7 | 4. 8GB以上的 micro TF卡 x1 8 | 5. win32diskimage工具 : https://gitlab.com/dongshanpi/tools/-/raw/main/win32diskimager-1.0.0-install.exe 9 | 6. SDcard专用格式化工具:https://gitlab.com/dongshanpi/tools/-/raw/main/SDCardFormatter5.0.1Setup.exe 10 | 7. TF卡最小系统镜像:https://gitlab.com/dongshanpi/tools/-/raw/main/100ask-t113-pro_sdcard.zip 11 | 12 | ## 运行烧写软件烧写 13 | 14 | 首先需要下载 **win32diskimage SDcard专用格式化** 这两个烧写TF卡的工具,然后获取到TF卡系统镜像文件**100ask-t113-pro_sdcard.zip**,获取到以后,先安装 **win32diskimage SDcard专用格式化** 这两个工具,同时可以解压 一下TF卡系统的镜像文件 **dongshannezhastu-sdcard.zip**,可以得到一个 **100ask-t113-pro_sdcard.img**文件 这个文件就是我们要烧写的镜像。 15 | 16 | 17 | 18 | * 使用SD CatFormat格式化TF卡,注意备份卡内数据。参考下图所示,点击刷新找到TF卡,然后点击 Format 在弹出的 对话框 点击 **是(Yes)**等待格式完成即可。 19 | 20 | ![SDCardFormat_001](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/SDCardFormat_001.png) 21 | 22 | * 格式化完成后,使用**Win32diskimage**工具来烧录镜像,参考下属步骤,找到自己的TF卡盘符,然后点击2 箭头 文件夹的符号 找到 刚才解压的 TF卡镜像文件 **dongshannezhastu-sdcard.img** 最后 点击 写入,等待写入完成即可。 23 | 24 | ![wind32diskimage_001](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/wind32diskimage_001.png) 25 | 26 | 27 | 完成以后,就可以弹出TF卡,并将其插到 东山哪吒STU 最小板背面的TF卡槽位置处,此时连接 串口线 并使用 串口工具打开串口设备,按下开发板的 **RESET**复位按键就可以重启进入TF卡系统内了。 28 | 29 | ## 启动系统 30 | ![sdcard-flashsystem_001](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/sdcard-flashsystem_001.png) 31 | 32 | **系统的登录用户名 root 密码为空** 33 | 34 | **系统的登录用户名 root 密码为空** 35 | 36 | **系统的登录用户名 root 密码为空** 37 | 38 | -------------------------------------------------------------------------------- /docs/03-QuickStart.md: -------------------------------------------------------------------------------- 1 | # 快速开始使用 2 | ## 上电启动系统 3 | 4 | **注意:开发板默认都有烧录SPI NAND FLASH系统,收到开发板后,只需要两根typec线即可启动** 5 | 6 | ### 1. 连接串口线电源线 7 | * 连接两根TypeC线分别到下图红框未知,一个是 OTG接口,用来供电和烧录功能,另一根为 串口线,用来调试输出。连接成功后,需要将底板上的电源切换开关拨至靠近 OTG口方向,此时核心板上的绿色电源灯也会亮起,灯亮起表示设备已经可以正常通电工作。 8 | * 对于串口接口, 默认情况下系统会自动安装串口设备驱动,如果没有自动安装,可以使用驱动精灵来自动安装。 9 | 10 | ![T113-Pro_FlashSystem](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/100ask_t113_pro/T113-Pro_FlashSystem.png) 11 | 12 | 13 | * 对于Windows系统 14 | 此时Windows设备管理器 在 端口(COM和LPT) 处会多出一个串口设备,一般是以 `USB-Enhanced-SERIAL CH9102`开头,您需要留意一下后面的具体COM编号,用于后续连接使用。 15 | 16 | ![QuickStart-01](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/QuickStart-01.png) 17 | 18 | 如上图,COM号是96,我们接下来连接所使用的串口号就是96。 19 | 20 | * 对于Linux系统 21 | 可以查看是否多出一个/dev/tty<> 设备,一般情况设备节点为 /dev/ttyACM0 。 22 | 23 | ![QuickStart-02](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/QuickStart-02.png) 24 | 25 | ### 2. 打开串口控制台 26 | #### 获取串口工具 27 | 使用Putty或者MobaXterm等串口工具来开发板设备。 28 | 29 | * 其中putty工具可以访问页面 https://www.chiark.greenend.org.uk/~sgtatham/putty/ 来获取。 30 | * MobaXterm可以通过访问页面 https://mobaxterm.mobatek.net/ 获取 (推荐使用)。 31 | 32 | #### 使用putty登录串口 33 | 34 | ![QuickStart-04](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/QuickStart-04.png) 35 | 36 | #### 使用Mobaxterm登录串口 37 | 打开MobaXterm,点击左上角的“Session”,在弹出的界面选中“Serial”,如下图所示选择端口号(前面设备管理器显示的端口号COM21)、波特率(Speed 115200)、流控(Flow Control: none),最后点击“OK”即可。步骤如下图所示。 38 | **注意:流控(Flow Control)一定要选择none,否则你将无法在MobaXterm中向串口输入数据** 39 | 40 | ![Mobaxterm_serial_set_001](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/Mobaxterm_serial_set_001.png) 41 | 42 | 43 | 44 | 45 | ### 3. 进入系统shell 46 | 使用串口工具成功打开串口后,可以直接按下 Enter 键 进入shell,当然您也可以按下板子上的 `Reset`复位键,来查看完整的系统信息。 47 | ![bootlogs_001](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/bootlogs_001.png) 48 | 49 | **系统默认的 登录 用户名 是 root 没有密码。** 50 | 51 | **系统默认的 登录 用户名 是 root 没有密码。** 52 | 53 | **系统默认的 登录 用户名 是 root 没有密码。** 54 | 55 | -------------------------------------------------------------------------------- /docs/04-StudyPath.md: -------------------------------------------------------------------------------- 1 | # 学习路线 2 | 3 | ## 基础情况 4 | 5 | ### 纯小白同学不懂Linux 6 | * 学习操作使用ubuntu系统: https://www.bilibili.com/video/BV1dU4y1D7fz 7 | * 学习Git工具: https://www.bilibili.com/video/BV1CL4y1A7YG 8 | * 学习Linux C编程: 参考小甲鱼课程 9 | * 学习嵌入式Linux 基本知识 : https://www.bilibili.com/video/BV1VN4y137Tf 10 | 11 | 12 | 13 | ### 懂一点Linux概念 14 | 15 | * 学习Git工具: https://www.bilibili.com/video/BV1CL4y1A7YG 16 | 17 | * 学习嵌入式Linux 基本知识 : https://www.bilibili.com/video/BV1VN4y137Tf 18 | 19 | 20 | 21 | 22 | ### 熟悉嵌入式Linux开发 23 | 24 | * 学习Tina-SDK开发 25 | * 学习Linux驱动开发 26 | * 学习专题课程(比如RISC-V架构专题) 27 | 28 | 29 | 30 | ## 工作岗位 31 | 32 | ### 嵌入式Linux 应用开发 33 | 34 | 初级 高级 35 | 36 | ### 嵌入式Linux驱动开发 37 | 38 | 初级 中级 高级 39 | 40 | 41 | 42 | ### 嵌入式系统开发 43 | 44 | 嵌入式Linux系统优化工程师 -------------------------------------------------------------------------------- /docs/05-1_RunHelloword.md: -------------------------------------------------------------------------------- 1 | # 运行输出hello word 2 | 3 | 4 | 5 | ## 配置开发环境 6 | 7 | 首先我们需要获取 交叉编译工具链。 8 | 9 | ## 获取交叉编译工具链 10 | 11 | 我们的源码都存放在不同的git仓库内,其中以github为主要托管,也是最新的状态,同时也会使用 gitee作为备用站点,根据大家的实际情况,来进行选择。 12 | 13 | * 对于可以访问github的同学 请使用如下命令获取源码 14 | 15 | ```bash 16 | git clone https://github.com/DongshanPI/eLinuxCore_100ask-t113-pro.git 17 | cd eLinuxCore_100ask-t113-pro 18 | git submodule update --init --recursive 19 | ``` 20 | 21 | 22 | 23 | * 对于无法访问GitHub的同学 请使用如下命令获取源码。 24 | 25 | ```bash 26 | git clone https://gitee.com/weidongshan/eLinuxCore_100ask-t113-pro.git 27 | cd eLinuxCore_100ask-t113-pro 28 | git submodule update --init --recursive 29 | ``` 30 | 31 | 32 | 33 | 获取完成源码后,需要进入到交叉编译工具链路径到 内,用于验证是否可用。 34 | 35 | ```bash 36 | book@virtual-machine:~/eLinuxCore_100ask-t113-pro/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin$ ./arm-linux-gnueabi-gcc -v 37 | Using built-in specs. 38 | COLLECT_GCC=./arm-linux-gnueabi-gcc 39 | COLLECT_LTO_WRAPPER=/home/book/eLinuxCore_100ask-t113-pro/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin/../libexec/gcc/arm-linux-gnueabi/7.2.1/lto-wrapper 40 | Target: arm-linux-gnueabi 41 | Configured with: '/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/arm-linux-gnueabi/snapshots/gcc.git~linaro-7.2-2017.11/configure' SHELL=/bin/bash --with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/arm-linux-gnueabi/_build/builds/destdir/x86_64-unknown-linux-gnu --with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/arm-linux-gnueabi/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/arm-linux-gnueabi/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gnu-as --with-gnu-ld --disable-libmudflap --enable-lto --enable-shared --without-included-gettext --enable-nls --disable-sjlj-exceptions --enable-gnu-unique-object --enable-linker-build-id --disable-libstdcxx-pch --enable-c99 --enable-clocale=gnu --enable-libstdcxx-debug --enable-long-long --with-cloog=no --with-ppl=no --with-isl=no --disable-multilib --with-float=soft --with-mode=thumb --with-tune=cortex-a9 --with-arch=armv7-a --enable-threads=posix --enable-multiarch --enable-libstdcxx-time=yes --enable-gnu-indirect-function --with-build-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/arm-linux-gnueabi/_build/sysroots/arm-linux-gnueabi --with-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/arm-linux-gnueabi/_build/builds/destdir/x86_64-unknown-linux-gnu/arm-linux-gnueabi/libc --enable-checking=release --disable-bootstrap --enable-languages=c,c++,fortran,lto --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=arm-linux-gnueabi --prefix=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/arm-linux-gnueabi/_build/builds/destdir/x86_64-unknown-linux-gnu 42 | Thread model: posix 43 | gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11) 44 | 45 | ``` 46 | 47 | 完成以后 我们就可以加入到 系统的 PATH环境变量内。 48 | 49 | 首先 需要获取 交叉编译工具链 所在的绝对路径,进入到 eLinuxCore_100ask-t113-pro/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin目录下执行 **pwd** 命令,即可得到绝对路径 ` /home/book/eLinuxCore_100ask-t113-pro/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin` 。 50 | 51 | ```bash 52 | book@virtual-machine:~/eLinuxCore_100ask-t113-pro/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin$ pwd 53 | /home/book/eLinuxCore_100ask-t113-pro/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin 54 | ``` 55 | 56 | 接下来,可以在终端下执行如下命令,讲这个加入到系统 环境变量内,这样就可以在任意位置执行 交叉编译工具链了。 57 | 58 | ```bash 59 | export PATH=$PATH:/home/book/eLinuxCore_100ask-t113-pro/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin 60 | ``` 61 | 62 | 注意:此方式只针对当前的终端有效,如果你关闭了这个终端,再次开启终端 需要重新执行才可以。 63 | 64 | 还有另一种永久生效的方式 就是写入到 系统环境变量里面,需要修改 **/etc/environment** 在末尾加上 你获取到的交叉编译工具链绝对路径,注意修改需要使用 sudo 命令。 65 | 66 | ```bash 67 | book@virtual-machine:~$ cat /etc/environment 68 | PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/book/eLinuxCore_100ask-t113-pro/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin" 69 | ``` 70 | 71 | 72 | 73 | ## 编写Hello word程序 74 | 75 | * 配置好交叉编译工具链以后,就可以开始编写我们的应用程序了,如下为一个最简单的 hello word打印示例程序。 76 | 77 | ```c 78 | #include 79 | int main (void) 80 | { 81 | printf("hello word!\n"); 82 | return 0; 83 | } 84 | ``` 85 | 86 | 编写完成后,保存到 helloword.c 87 | 88 | 之后我们执行 如下编译命令进行编译 89 | 90 | ```bash 91 | book@virtual-machine:~$ vim helloword.c 92 | book@virtual-machine:~$ arm-linux-gnueabi-gcc -o helloword helloword.c 93 | ``` 94 | 95 | ## 拷贝到开发板 96 | 97 | 怎么拷贝文件到开发板上? 有U盘 ADB 网络 串口等等。 98 | 99 | 那么我们优先推进使用 网络方式,网络也有很多,有TFTP传输,有nfs传输,有SFTP传输,其中nfs传输需要内核支持 nfs文件系统,SFTP需要根文件系统支持 openssh组件服务,那么最终我们还是选用tftp服务。 100 | 101 | 102 | 103 | ### 使用usb adb方式 104 | 105 | * 首先将开发板OTG线连接,系统内默认启动会自动启动一个 usb adb服务,这时电脑会弹出一个设备,进入到我们的VMware虚拟机讲弹出来的设备,连接到ubuntu内。 106 | * 这时我可以使用 adb push命令来上传文件,开始上传之前可以使用 adb devices 命令来查看开发板是否连接到系统上。 107 | * 如下示例,使用adb命令 上传 helloword到 开发板的 /root下。 108 | 109 | ```shell 110 | adb push helloword /root 111 | ``` 112 | 113 | 114 | 115 | ## 运行 116 | 117 | 下载好程序以后,需要使用chmod +x 命令来给程序添加可执行权限,之后 我们就可以执行 这个helloword应用了。 118 | 119 | ```bash 120 | # chmod +x helloword 121 | # ./helloword 122 | hello word! 123 | # 124 | ``` 125 | 126 | -------------------------------------------------------------------------------- /docs/05-2_RunHellowordDriver.md: -------------------------------------------------------------------------------- 1 | # 编译运行Helloword驱动 2 | 3 | ## 配置开发环境 4 | 5 | 首先我们需要获取 配套的交叉编译工具链. 6 | 7 | 由于目前工具链没有提供windows版本,所以只能在 Linux下进行,操作,请先参考上述章节 配置ubuntu 虚拟机章节,进行配置,并配置好。 8 | 9 | 10 | ## 获取kernel源码工程 11 | 我们的源码都存放在不同的git仓库内,其中以github为主要托管,也是最新的状态,同时也会使用 gitee作为备用站点,根据大家的实际情况,来进行选择。 12 | 13 | * 对于可以访问github的同学 请使用如下命令获取源码 14 | 15 | ```bash 16 | git clone https://github.com/DongshanPI/eLinuxCore_100ask-t113-pro 17 | cd eLinuxCore_100ask-t113-pro 18 | git submodule update --init --recursive 19 | ``` 20 | 21 | 22 | * 对于无法访问GitHub的同学 请使用如下命令获取源码。 23 | 24 | ```bash 25 | git clone https://gitee.com/weidongshan/eLinuxCore_100ask-t113-pro.git 26 | cd eLinuxCore_100ask-t113-pro 27 | git submodule update --init --recursive 28 | ``` 29 | 30 | 31 | ## 配置内核编译环境 32 | ```bash 33 | export PATH=$PATH:/home/book/eLinuxCore_100ask-t113-pro/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin 34 | export ARCH=arm 35 | export CROSS_COMPILE=arm-linux-gnueabi- 36 | ``` 37 | ```bash 38 | sun8iw20p1smp_defconfigbook@100ask:~/eLinuxCore_100ask-t113-pro/linux$ export ARCH=arm 39 | book@100ask:~/eLinuxCore_100ask-t113-pro/linux$ export CROSS_COMPILE=arm-linux-gnueabi- 40 | book@100ask:~/eLinuxCore_100ask-t113-pro/linux$ export PATH=$PATH:/home/book/eLinuxCore_100ask-t113-pro/toolchain/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin 41 | book@100ask:~/NezhaSTU/eLinuxCore_100ask-t113-pro/linux$ make sun8iw20p1smp_defconfig 42 | HOSTCC scripts/basic/fixdep 43 | HOSTCC scripts/kconfig/conf.o 44 | HOSTCC scripts/kconfig/confdata.o 45 | HOSTCC scripts/kconfig/expr.o 46 | LEX scripts/kconfig/lexer.lex.c 47 | YACC scripts/kconfig/parser.tab.[ch] 48 | HOSTCC scripts/kconfig/lexer.lex.o 49 | HOSTCC scripts/kconfig/parser.tab.o 50 | HOSTCC scripts/kconfig/preprocess.o 51 | HOSTCC scripts/kconfig/symbol.o 52 | HOSTLD scripts/kconfig/conf 53 | # 54 | # configuration written to .config 55 | # 56 | book@100ask:~/eLinuxCore_100ask-t113-pro/linux$ make zImage -j8 57 | 58 | ``` 59 | 60 | 61 | 62 | ## 编写 helloword驱动 63 | 64 | hello_drv.c 65 | 66 | ```c 67 | #include 68 | 69 | #include 70 | #include 71 | #include 72 | #include 73 | #include 74 | #include 75 | #include 76 | #include 77 | #include 78 | #include 79 | #include 80 | #include 81 | #include 82 | #include 83 | 84 | /* 1. 确定主设备号 */ 85 | static int major = 0; 86 | static char kernel_buf[1024]; 87 | static struct class *hello_class; 88 | 89 | 90 | #define MIN(a, b) (a < b ? a : b) 91 | 92 | /* 3. 实现对应的open/read/write等函数,填入file_operations结构体 */ 93 | static ssize_t hello_drv_read (struct file *file, char __user *buf, size_t size, loff_t *offset) 94 | { 95 | int err; 96 | printk("%s %s line %d\n", __FILE__, __FUNCTION__, __LINE__); 97 | err = copy_to_user(buf, kernel_buf, MIN(1024, size)); 98 | return MIN(1024, size); 99 | } 100 | 101 | static ssize_t hello_drv_write (struct file *file, const char __user *buf, size_t size, loff_t *offset) 102 | { 103 | int err; 104 | printk("%s %s line %d\n", __FILE__, __FUNCTION__, __LINE__); 105 | err = copy_from_user(kernel_buf, buf, MIN(1024, size)); 106 | return MIN(1024, size); 107 | } 108 | 109 | static int hello_drv_open (struct inode *node, struct file *file) 110 | { 111 | printk("%s %s line %d\n", __FILE__, __FUNCTION__, __LINE__); 112 | return 0; 113 | } 114 | 115 | static int hello_drv_close (struct inode *node, struct file *file) 116 | { 117 | printk("%s %s line %d\n", __FILE__, __FUNCTION__, __LINE__); 118 | return 0; 119 | } 120 | 121 | /* 2. 定义自己的file_operations结构体 */ 122 | static struct file_operations hello_drv = { 123 | .owner = THIS_MODULE, 124 | .open = hello_drv_open, 125 | .read = hello_drv_read, 126 | .write = hello_drv_write, 127 | .release = hello_drv_close, 128 | }; 129 | 130 | /* 4. 把file_operations结构体告诉内核:注册驱动程序 */ 131 | /* 5. 谁来注册驱动程序啊?得有一个入口函数:安装驱动程序时,就会去调用这个入口函数 */ 132 | static int __init hello_init(void) 133 | { 134 | int err; 135 | 136 | printk("%s %s line %d\n", __FILE__, __FUNCTION__, __LINE__); 137 | major = register_chrdev(0, "hello", &hello_drv); /* /dev/hello */ 138 | 139 | 140 | hello_class = class_create(THIS_MODULE, "hello_class"); 141 | err = PTR_ERR(hello_class); 142 | if (IS_ERR(hello_class)) { 143 | printk("%s %s line %d\n", __FILE__, __FUNCTION__, __LINE__); 144 | unregister_chrdev(major, "hello"); 145 | return -1; 146 | } 147 | 148 | device_create(hello_class, NULL, MKDEV(major, 0), NULL, "hello"); /* /dev/hello */ 149 | 150 | return 0; 151 | } 152 | 153 | /* 6. 有入口函数就应该有出口函数:卸载驱动程序时,就会去调用这个出口函数 */ 154 | static void __exit hello_exit(void) 155 | { 156 | printk("%s %s line %d\n", __FILE__, __FUNCTION__, __LINE__); 157 | device_destroy(hello_class, MKDEV(major, 0)); 158 | class_destroy(hello_class); 159 | unregister_chrdev(major, "hello"); 160 | } 161 | 162 | 163 | /* 7. 其他完善:提供设备信息,自动创建设备节点 */ 164 | 165 | module_init(hello_init); 166 | module_exit(hello_exit); 167 | 168 | MODULE_LICENSE("GPL"); 169 | ``` 170 | 171 | ```c 172 | 173 | #include 174 | #include 175 | #include 176 | #include 177 | #include 178 | #include 179 | 180 | /* 181 | * ./hello_drv_test -w abc 182 | * ./hello_drv_test -r 183 | */ 184 | int main(int argc, char **argv) 185 | { 186 | int fd; 187 | char buf[1024]; 188 | int len; 189 | 190 | /* 1. 判断参数 */ 191 | if (argc < 2) 192 | { 193 | printf("Usage: %s -w \n", argv[0]); 194 | printf(" %s -r\n", argv[0]); 195 | return -1; 196 | } 197 | 198 | /* 2. 打开文件 */ 199 | fd = open("/dev/hello", O_RDWR); 200 | if (fd == -1) 201 | { 202 | printf("can not open file /dev/hello\n"); 203 | return -1; 204 | } 205 | 206 | /* 3. 写文件或读文件 */ 207 | if ((0 == strcmp(argv[1], "-w")) && (argc == 3)) 208 | { 209 | len = strlen(argv[2]) + 1; 210 | len = len < 1024 ? len : 1024; 211 | write(fd, argv[2], len); 212 | } 213 | else 214 | { 215 | len = read(fd, buf, 1024); 216 | buf[1023] = '\0'; 217 | printf("APP read : %s\n", buf); 218 | } 219 | 220 | close(fd); 221 | 222 | return 0; 223 | } 224 | 225 | ``` 226 | 227 | 228 | 229 | Makefile: 230 | 231 | ```makefile 232 | 233 | # 1. 使用不同的开发板内核时, 一定要修改KERN_DIR 234 | # 2. KERN_DIR中的内核要事先配置、编译, 为了能编译内核, 要先设置下列环境变量: 235 | # 2.1 ARCH, 比如: export ARCH=arm64 236 | # 2.2 CROSS_COMPILE, 比如: export CROSS_COMPILE=aarch64-linux-gnu- 237 | # 2.3 PATH, 比如: export PATH=$PATH:/home/book/100ask_roc-rk3399-pc/ToolChain-6.3.1/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin 238 | # 注意: 不同的开发板不同的编译器上述3个环境变量不一定相同, 239 | # 请参考各开发板的高级用户使用手册 240 | 241 | KERN_DIR = /home/book/eLinuxCore_100ask-t113-pro/linux/ 242 | 243 | all: 244 | make -C $(KERN_DIR) M=`pwd` modules 245 | $(CROSS_COMPILE)gcc -o hello_drv_test hello_drv_test.c 246 | 247 | clean: 248 | make -C $(KERN_DIR) M=`pwd` modules clean 249 | rm -rf modules.order 250 | rm -f hello_drv_test 251 | 252 | obj-m += hello_drv.o 253 | 254 | ``` 255 | 256 | ### 编译 257 | 258 | ```bash 259 | book@100ask:~$ make 260 | make -C /home/book/NezhaSTU/eLinuxCore_100ask-t113-pro/linux/ M=`pwd` modules 261 | make[1]: Entering directory '/home/book/NezhaSTU/eLinuxCore_100ask-t113-pro/linux' 262 | CC [M] /home/book/NezhaSTU/hello_drv.o 263 | Building modules, stage 2. 264 | MODPOST 1 modules 265 | CC [M] /home/book/NezhaSTU/hello_drv.mod.o 266 | LD [M] /home/book/NezhaSTU/hello_drv.ko 267 | make[1]: Leaving directory '/home/book/NezhaSTU/eLinuxCore_100ask-t113-pro/linux' 268 | riscv64-unknown-linux-gnu-gcc -o hello_drv_test hello_drv_test.c 269 | book@100ask:~$ 270 | ``` 271 | 272 | 273 | 274 | ## 拷贝到开发板 275 | 276 | 怎么拷贝文件到开发板上? 有U盘 ADB 网络 串口等等。 277 | 278 | 那么我们优先推进使用 网络方式,网络也有很多,有TFTP传输,有nfs传输,有SFTP传输,其中nfs传输需要内核支持 nfs文件系统,SFTP需要根文件系统支持 openssh组件服务,那么最终我们还是选用tftp服务。 279 | 280 | ### 使用tftp网络服务 281 | 282 | 1. 首先,需要你的ubuntu系统支持 tftp服务,已经配置并且安装好,然后讲编译出来的 helloword程序 拷贝到 tftp目录下。 283 | 284 | ```bash 285 | book@100ask:~$ cp hello_drv_test hello_drv.ko ~/tftpboot/ 286 | ``` 287 | 288 | 2. 进入到开发板内,首先让开发板可以获取到IP地址,并且可以和 ubuntu系统ping通(这里指的是编译helloword主机),之后我们在开发板上 获取 helloword 应用程序,并执行。 289 | 290 | ```bash 291 | # udhcpc 292 | udhcpc: started, v1.35.0 293 | [ 974.154486] libphy: 4500000.eth: probed 294 | [ 974.159083] sunxi-gmac 4500000.eth eth0: eth0: Type(8) PHY ID 001cc916 at 0 IRQ poll (4500000.eth-0:00) 295 | udhcpc: broadcasting discover 296 | udhcpc: broadcasting discover 297 | [ 979.331180] sunxi-gmac 4500000.eth eth0: Link is Up - 1Gbps/Full - flow control off 298 | [ 979.340154] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready 299 | udhcpc: broadcasting discover 300 | udhcpc: broadcasting select for 192.168.1.47, server 192.168.1.1 301 | udhcpc: lease of 192.168.1.47 obtained from 192.168.1.1, lease time 86400 302 | deleting routers 303 | adding dns 192.168.1.1 304 | # [ 992.315224] random: crng init done 305 | [ 992.319022] random: 2 urandom warning(s) missed due to ratelimiting 306 | 307 | # tftp -g -r hello_drv.ko 192.168.1.133 308 | # tftp -g -r hello_drv_test 192.168.1.133 309 | # ls 310 | hello_drv.ko hello_drv_test helloword 311 | ``` 312 | 313 | 如上所示,我的ubuntu主机IP地址是 192.168.1.133 ,所以使用tftp 从 ubuntu获取helloword 程序,获取速度根据网速而定。 314 | 315 | ### 使用usb adb方式 316 | 317 | * 首先将开发板OTG线连接,系统内默认启动会自动启动一个 usb adb服务,这时电脑会弹出一个设备,进入到我们的VMware虚拟机讲弹出来的设备,连接到ubuntu内。 318 | * 这时我可以使用 adb push命令来上传文件,开始上传之前可以使用 adb devices 命令来查看开发板是否连接到系统上。 319 | * 如下示例,使用adb命令 上传 helloword到 开发板的 /root下。 320 | 321 | ```shell 322 | adb push helloword /root 323 | ``` 324 | 325 | 326 | 327 | ## 运行 328 | 329 | ```bash 330 | # insmod hello_drv.ko 331 | [ 1007.072991] hello_drv: loading out-of-tree module taints kernel. 332 | [ 1007.081285] /home/book/NezhaSTU/hello_drv.c hello_init line 70 333 | # chmod +x hello_drv_test 334 | # ls /dev/h 335 | hdmi hello 336 | # ls /dev/hello 337 | /dev/hello 338 | # ./hello_drv 339 | hello_drv.ko hello_drv_test 340 | # ./hello_drv_test -w abc 341 | [ 1060.000621] /home/book/NezhaSTU/hello_drv.c hello_drv_open line 45 342 | [ 1060.007613] /home/book/NezhaSTU/hello_drv.c hello_drv_write line 38 343 | [ 1060.015194] /home/book/NezhaSTU/hello_drv.c hello_drv_close line 51 344 | # ./hello_drv_test -r 345 | [ 1062.312864] /home/book/NezhaSTU/hello_drv.c hello_drv_open line 45 346 | [ 1062.319853] /home/book/NezhaSTU/hello_drv.c hello_drv_read line 30 347 | APP read : abc[ 1062.327680] /home/book/NezhaSTU/hello_drv.c hello_drv_close line 51 348 | 349 | # 350 | ``` 351 | 352 | -------------------------------------------------------------------------------- /docs/06-ConfigHostEnv.md: -------------------------------------------------------------------------------- 1 | # 安装并配置开发环境 2 | 3 | 4 | ## 获取虚拟机系统 5 | 6 | ### 下载vmware虚拟机工具 7 | 8 | 使用浏览器打开网址 https://www.vmware.com/products/workstation-pro/workstation-pro-evaluation.html 参考下图箭头所示,点击下载安装 Windows版本的VMware Workstation ,点击 **DOWNLOAD NOW** 即可开始下载。 9 | 10 | ![vmwareworkstation_download_001](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/vmwareworkstation_download_001.png) 11 | 12 | 下载完成后全部使用默认配置一步步安装即可。 13 | 14 | 15 | 16 | ### 获取Ubuntu系统镜像 17 | 18 | * 使用浏览器打开 https://www.linuxvmimages.com/images/ubuntu-1804/ 找到如下箭头所示位置,点击 **VMware Image** 下载。 19 | 20 | ![linuxvmimage_downlaod_001](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/linuxvmimage_downlaod_001.png) 21 | 22 | 下载过程可能会持续 10 到 30 分钟,具体要依据网速而定。 23 | 24 | 25 | 26 | ## 运行虚拟机系统 27 | 28 | 1. 解压缩 虚拟机系统镜像压缩包,解压缩完成后,可以看到里面有如下两个文件,接下来,我们会使用 后缀名为 .vmx 这个 配置文件。 29 | 30 | ![ConfigHost_003](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/ConfigHost_003.png) 31 | 32 | 2. 打开已经安装好的 vmware workstation 软件 点击左上角的 **文件** --> **打开** 找到上面的 Ubuntu_18.04.6_VM_LinuxVMImages.COM.vmx 文件,之后会弹出新的虚拟机对话框页面。 33 | 34 | ![ConfigHost_004](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/ConfigHost_004.png) 35 | 36 | 3. 如下图所示为 为我们已经虚拟机的配置界面,那面我们可以 点击 红框 2 编辑虚拟机设置 里面 去调正 我们虚拟机的 内存 大小 和处理器个数,建议 最好 内存为 4GB 及以上,处理器至少4 个。 调整好以后,就可以 点击 **开启此虚拟机** 来运行此虚拟机了 37 | 38 | ![ConfigHost_005](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/ConfigHost_005.png) 39 | 40 | 第一次打开会提示 一个 虚拟机已经复制的 对话框,我们这时,只需要 点击 我已复制虚拟机 就可以继续启动虚拟机系统了。 41 | 42 | ![ConfigHost_006](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/ConfigHost_006.png) 43 | 44 | 等待数秒,系统就会自动启动了,启动以后 鼠标点击 **Ubuntu** 字样,就可以进入登录对话框,输入 密码 ubuntu 即可登录进入ubuntu系统内。 45 | 46 | 注意: 47 | 48 | **Ubuntu默认的用户名密码分别为 ubuntu ubuntu** 49 | 50 | **Ubuntu默认的用户名密码分别为 ubuntu ubuntu** 51 | 52 | **Ubuntu默认的用户名密码分别为 ubuntu ubuntu** 53 | 54 | **ubuntu默认需要联网,如果你的 Windows电脑已经可以访问Internet 互联网,ubuntu系统后就会自动共享 Windows电脑的网络 进行连接internet 网络。** 55 | 56 | 57 | 58 | ### 配置开发环境 59 | 60 | 61 | 62 | * 安装必要软件包, 鼠标点击进入 ubuntu界面内,键盘同时 按下 **ctrl + alt + t** 三个按键会快速唤起,终端界面,唤起成功后,在终端里面执行如下命令进行安装必要依赖包。 63 | 64 | ```bash 65 | sudo apt-get install -y sed make binutils build-essential gcc g++ bash patch gzip bzip2 perl tar cpio unzip rsync file bc wget python cvs git mercurial rsync subversion android-tools-mkbootimg vim libssl-dev android-tools-fastboot 66 | ``` 67 | 68 | 如果你发现你的ubuntu虚拟机 第一次启动 无法 通过 windows下复制 命令 粘贴到 ubuntu内,则需要先手敲 执行如下命令 安装一个 用于 虚拟机和 windows共享剪切板的工具包。 69 | 70 | ```bash 71 | sudo apt install open-vm-tools-desktop 72 | ``` 73 | 74 | ![ConfigHost_007](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/ConfigHost_007.png) 75 | 76 | 安装完成后,点击右上角的 电源按钮,重启ubuntu系统,或者 直接输入 sudo reboot 命令进行重启。 77 | 78 | 这时就可以 通过windows端向ubuntu内粘贴文件,或者拷贝拷出文件了。 79 | 80 | ![ConfigHost_008](https://cdn.staticaly.com/gh/DongshanPI/Docs-Photos@master/DongshanNezhaSTU/ConfigHost_008.png) 81 | 82 | 做完这一步以后,就可以继续往下,获取源码 开始RISC-V 东山哪吒STU开发板的开发之旅了。 83 | -------------------------------------------------------------------------------- /docs/07-Buildroot-SDK_DevelopmentGuide.md: -------------------------------------------------------------------------------- 1 | # 使用buildroot-SDK编译构建系统 2 | 3 | ## 简介 4 | 5 | * 此套构建系统基于全志T113-S3芯片,适配了buildroot 2022lts主线版本,兼容了百问网的项目课程以及相关组件,真正做到了低耦合,高可用,使用不同的buildroot external tree规格,讲不同的项目 不同的组件分别管理,来实现更容易上手 也更容易学习理解。 6 | 7 | 8 | 9 | 10 | ## 安装必要依赖包 11 | 12 | ### ubuntu-18.04 13 | 14 | 运行环境配置: 此系统基于ubuntu18.04进行验证,在之前的基础之上还需要安装以下必要依赖 15 | 16 | 17 | ```bash 18 | book@100ask:~$ sudo apt-get install build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl mercurial bzr ecj cvs unzip lib32z1 lib32z1-dev lib32stdc++6 libstdc++6 libncurses-dev u-boot-tools -y 19 | ``` 20 | 21 | * 安装完成后,执行如下命令进行开始编译操作。 22 | 23 | 24 | ## 获取sdk源码 25 | 26 | 27 | * 默认源码都存放在github仓库内,请使用如下命令获取 28 | 29 | ```bash 30 | book@100ask:~$ git clone https://github.com/DongshanPI/buildroot-100ask_t113-pro 31 | book@100ask:~$ cd buildroot-100ask_t113-pro/ 32 | book@100ask:~/buildroot-100ask_t113-pro$ git submodule update --init --recursive 33 | book@100ask:~/buildroot-100ask_t113-pro$ git submodule update --recursive --remote 34 | book@100ask:~/buildroot-100ask_t113-pro$ cd buildroot/ 35 | book@100ask:~/buildroot-100ask_t113-pro/buildroot$ git submodule update --init --recursive 36 | 37 | ``` 38 | 39 | 40 | * 对于国内无法访问github的同学,可以使用国内备用gitee站点, 如下命令。 41 | 42 | ```bash 43 | book@100ask:~$ git clone https://gitee.com/weidongshan/buildroot-100ask_t113-pro 44 | book@100ask:~$ cd buildroot-100ask_t113-pro/ 45 | book@100ask:~/buildroot-100ask_t113-pro$ git submodule update --init --recursive 46 | book@100ask:~/buildroot-100ask_t113-pro$ git submodule update --recursive --remote 47 | book@100ask:~/buildroot-100ask_t113-pro$ cd buildroot/ 48 | book@100ask:~/buildroot-100ask_t113-pro/buildroot$ git submodule update --init --recursive 49 | ``` 50 | 51 | 52 | 53 | ## 最小系统编译烧写 54 | 55 | ### 编译sdcard 最小系统镜像 56 | 57 | ```bash 58 | book@100ask:~/buildroot-100ask_t113-pro/buildroot$ make BR2_EXTERNAL="../br2t113pro ../br2lvgl " 100ask_t113-pro_sdcard_core_defconfig 59 | book@100ask:~/buildroot-100ask_t113-pro/buildroot$ make V=1 60 | 61 | ``` 62 | 63 | ### 烧写sdcard 最小系统镜像 64 | 65 | 编译完成后会在 output/images目录下输出 sdcard.img 文件,将文件拷贝到Windows系统下使用 wind32diskimage烧写,或者使用dd if 烧录到tf卡内, 66 | 之后插到开发板上,即可启动。 请参考左侧 [快速启动](https://dongshanpi.com/DongshanNezhaSTU/03-QuickStart/#tf) 页面 67 | 68 | 69 | 70 | ### 编译spi nand最小系统镜像 71 | 72 | ```bash 73 | book@100ask:~/buildroot-100ask_t113-pro/buildroot$ make BR2_EXTERNAL="../br2t113pro ../br2lvgl" 100ask_t113-pro_spinand_core_defconfig 74 | book@100ask:~/buildroot-100ask_t113-pro/buildroot$ make V=1 75 | ``` 76 | 77 | 78 | 79 | ### 烧写spi nand最小系统镜像 80 | 81 | 编译完成后会在 output/images目录下输出 buildroot_linux_nand_uart3.img 文件,将文件拷贝到Windows系统下使用 使用 全志官方的 AllwinnertechPhoeniSuit 进行烧写。 82 | 详细烧写步骤请,请参考左侧 [快速启动](https://dongshanpi.com/DongshanNezhaSTU/03-QuickStart/#spi-nand) 页面。 83 | -------------------------------------------------------------------------------- /docs/08-BuildBootloader.md: -------------------------------------------------------------------------------- 1 | # 使用buildroot-SDK编译构建Bootloader 2 | 3 | * 东山哪吒STU开发板,Bootloader由4部分组成, 第一部分是 boot0 阶段,用于初始化CPU DDR UART 时钟等一些必要外设和引脚分配,之后进入第二部分,第二部分是 uboot board.dtb 这三部分组成,为一个 boot_package.fex 文件。 4 | * 所以Bootloader的整体的启动流程是,boot0-->u-boot-->board.dtb 5 | 6 | ## 单独编译打包第一部分 7 | 8 | ## 单独编译打包第二部分 9 | 10 | ### 单独编译 uboot 11 | 12 | * 单独编译 uboot阶段 13 | ``` shell 14 | book@virtual-machine:~/Neza-D1/buildroot-2021$ make uboot-rebuild V=1 15 | ``` 16 | 17 | ### 单独编译 board.dtb 18 | -------------------------------------------------------------------------------- /docs/09-BuildLinuxKernel.md: -------------------------------------------------------------------------------- 1 | # 使用buildroot-SDK编译打包Linux Kernel 2 | ### 单独编译各个部分 3 | 4 | 5 | 6 | 7 | 8 | * 单独编译 kernel阶段 9 | ``` shell 10 | book@virtual-machine:~/Neza-D1/buildroot-2021$ make linux-rebuild V=1 11 | ``` 12 | 13 | * 单独编译文件系统 14 | * 指定完成工具链 系统配置 需要安装的包 以及所需的格式 执行如下命令,最后生成的镜像在 output/image目录下。 15 | ``` shell 16 | book@virtual-machine:~/Neza-D1/buildroot-2021$ make all //完整编译系统 17 | ``` 18 | -------------------------------------------------------------------------------- /docs/10-1_BuildrootSupportWifiBluetooth.md: -------------------------------------------------------------------------------- 1 | # 使用buildroot-SDK编译构建rootfs 2 | 3 | ## 单独编译配置busybox 4 | 5 | 6 | 7 | ``` shell 8 | book@virtual-machine:~/Neza-D1/buildroot-2021$ make busybox-menuconfig 9 | ``` 10 | 11 | ### 清理无效缓存 重新打包 12 | 13 | ``` shell 14 | rm -rf output/target; find output/build/ -name .stamp_target_installed | xargs rm ; make 15 | ``` -------------------------------------------------------------------------------- /docs/10-BuildRootfs.md: -------------------------------------------------------------------------------- 1 | # 使用buildroot-SDK编译构建rootfs 2 | 3 | ## 单独编译配置busybox 4 | 5 | 6 | 7 | ``` shell 8 | book@virtual-machine:~/Neza-D1/buildroot-2021$ make busybox-menuconfig 9 | ``` 10 | 11 | ### 清理无效缓存 重新打包 12 | 13 | ``` shell 14 | rm -rf output/target; find output/build/ -name .stamp_target_installed | xargs rm ; make 15 | ``` -------------------------------------------------------------------------------- /docs/11-StartProcessAnalysis.md: -------------------------------------------------------------------------------- 1 | # 使用Tina-SDK编译构建系统 2 | 3 | ### 配置开发环境 4 | * 访问 https://d1.docs.aw-ol.com/study/study_1tina/ 5 | 6 | 7 | * 使用我们提前整理好的资料光盘 链接:https://pan.baidu.com/s/13uKlqDXImmMl9cgKc41tZg?pwd=qcw7 提取码:qcw7 --------------------------------------------------------------------------------